Python Lambda Syntax
Multiple Choice Medium
Question
What does `(lambda x, y: x + y)(3, 4)` return?
Hint
Lambda defines an anonymous function and here it is called immediately.
Explanation
lambda x, y: x + y creates an anonymous function that adds two numbers. Calling it with (3, 4) gives 3 + 4 = 7. Lambdas are single-expression functions, often used with map, filter, and sort.
Related Resources
Related Lessons
- Lambda Functions
Lambda syntax.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.