R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which of the following creates an anonymous function?

  • (A) def add(x, y): return x + y
  • (B) lambda x, y: x + y
  • (C) def: x + y
  • (D) function(x, y) => x + y
  • Correct Answer - Option(B)
  • Views: 17
  • Filed under category Python
  • Hashtags:

Explanation by: Ram Sharma

`lambda` is used to define anonymous (unnamed) functions.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.