Question 3
Back to Exercise
The program below stops with an error. Which statement correctly describes the problem?
area = lambda length, width: length * width
print(area(5))
- A It prints 5
- B It prints 25
- C SyntaxError
- D TypeError: the lambda needs two arguments but got one; pass width too or give it a default Correct
Correct Answer: Option D
Lambdas follow the same argument rules as def functions.
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!