Certified Associate in Python Programming (PCAP-31-03) — Question 74
Which of the following lambda function definitions are correct? (Choose two.)
Answer options
- A. lambda lambda: lambda * lambda
- B. lambda x : def fun(x): return x
- C. lambda : 3.1415
- D. lambda x : None
Correct answer: C, D
Explanation
Options C and D are correct as they represent valid lambda function definitions. Option C creates a lambda that returns a constant value, while option D defines a lambda that takes one argument and returns None. Options A and B are incorrect due to syntax errors in their definitions.