Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute PCAP-31-03 Exam - Topic 4 Question 108 Discussion

Which of the following lambda function definitions are correct? (Select two answers)
A) lambda X : None and B) lambda : 3,1415
C) lambda x : def fun(x): return x
D) lambda lambda: lambda * lambda

Python Institute PCAP-31-03 Exam - Topic 4 Question 108 Discussion

Actual exam question for Python Institute's PCAP-31-03 exam
Question #: 108
Topic #: 4
[All PCAP-31-03 Questions]

Which of the following lambda function definitions are correct? (Select two answers)

Show Suggested Answer Hide Answer
Suggested Answer: A, B

Contribute your Thoughts:

0/2000 characters
Domitila
3 days ago
I agree with you, C is definitely wrong!
upvoted 0 times
...
German
8 days ago
Wait, D looks super weird. Is that even allowed?
upvoted 0 times
...
Willodean
13 days ago
C is a no-go, can't define a function inside a lambda.
upvoted 0 times
...
Lemuel
19 days ago
I think B is also valid, right?
upvoted 0 times
...
Tish
24 days ago
A is definitely correct!
upvoted 0 times
...
Cherrie
29 days ago
D looks really confusing; I don't think you can have nested lambdas like that, but I might be mixing it up with something else we practiced.
upvoted 0 times
...
Ula
1 month ago
I think C is definitely wrong because you can't define a function inside a lambda like that.
upvoted 0 times
...
Shasta
1 month ago
I'm not sure about B; it looks like it might be trying to return a float, but isn't it missing a return statement?
upvoted 0 times
...
Samira
1 month ago
I remember that lambda functions should have a single expression, so A seems correct.
upvoted 0 times
...

Save Cancel