LearnFrenzy
Sign in Take a free test

Lambda Functions · Lambda Functions MCQ · Question 2

return inside a lambda Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 2 Back to Exercise

What happens with lambda x: return x * 2?

  • A It returns x * 2
  • B It returns None
  • C It raises TypeError when called
  • D SyntaxError – a lambda returns its expression without the return keyword Correct
Correct Answer: Option D

Write lambda x: x * 2.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links