Python Lambda Functions Quiz (Interactive MCQ with Answers)

🐍 Python Lambda Functions Interactive Quiz

Test your understanding of Python lambda (anonymous) functions.

What Are Python Lambda Functions?

Lambda functions are small anonymous functions in Python that can be created in a single line using the lambda keyword. They are commonly used when a simple function is needed temporarily.

This quiz covers:

  • Lambda syntax
  • Anonymous functions
  • Single-expression rules
  • Multiple parameters
  • map()
  • filter()
  • sorted()

Take the quiz below to test your understanding of Python Lambda Functions.

⏱ Time Left: 120 seconds

Q1. What is a lambda function?




Q2. Which keyword is used to create lambda?




Q3. Lambda functions can have:




Q4. Lambda functions can contain:




Q5. What is the output?


f = lambda x: x * 2
print(f(5))



Q6. Lambda functions are commonly used with:




Q7. Lambda is written in:



Q8. Which is correct lambda syntax?




Q9. Can lambda have return statement?



Q10. Why use lambda functions?




Q11. What is the output?


f = lambda a, b: a + b
print(f(3, 4))



Q12. What is the output?


nums = [1,2,3]
result = list(map(lambda x: x*2, nums))
print(result)



Q13. What is the output?


nums = [5,2,8,1]
print(sorted(nums, key=lambda x: x))




Q. Where Are Lambda Functions Used?

    Ans: Lambda Functions are used in:
  • map() for transforming data
  • filter() for selecting data
  • sorted() for custom sorting
  • Short one-time calculations
  • Data processing and automation scripts

Want to learn more about Lambda in Python with simple and easy to understand video explanation? Read Python Lambda Function Tutorial


📚 Continue Learning and Testing Your Python Knowledge Step by Step:


No comments:

Post a Comment

Featured Post

Python Lambda Functions Quiz (Interactive MCQ with Answers)

🐍 Python Lambda Functions Interactive Quiz Test your understanding of Python lambda (anonymous) functions. What Are Python Lambda Func...

Popular Posts