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.