相关文章推荐
内向的小蝌蚪  ·  GitHub - ...·  5 天前    · 
唠叨的石榴  ·  How do I use ...·  3 天前    · 
没人理的油条  ·  jq命令 :: AWS Workshop·  19 小时前    · 
安静的春卷  ·  Drowsiness Detection ...·  2 小时前    · 
近视的熊猫  ·  matlab求函数零点-掘金·  2 年前    · 
害羞的毛豆  ·  vba error method ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm trying to execute the following code, but I keep on getting this error. I've checked tutorials of "map" & "lambda" over and again, but couldn't discover the issue. Kindly help.

import re
import requests
source = requests.get('https://www.youtube.com/c/CoinBureau/videos').text
URLs = re.findall("/watch\?v=\w*", source)
URL_IDs = list(map(lamda x: x[9:], URLs))

You have a minor typo. The spelling of lambda is wrong.

Fix the error here

URL_IDs = list(map(lamda x: x[9:], URLs))

with the following

URL_IDs = list(map(lambda x: x[9:], URLs))
source = requests.get('https://www.youtube.com/c/CoinBureau/videos').text
URLs = re.findall("/watch\?v=\w*", source)
URL_IDs = list(map(lambda x: (x[9:]), URLs))

btw, you wrote lamda instead of lambda

I think you need this info for formatting correctly: stackoverflow.com/editing-help This for making a better answer How to Answer and this for generally understanding StackOverflow better: tour. – Yunnosch Feb 3 at 15:17

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.