Lambda Transformations Quiz

5 questions Pass: 70% +25 pts (50 with Pro)

Quiz covering Data Transformation

What you'll be asked

  1. In Python, what is the primary purpose of a lambda function?
  2. Which of the following syntax examples correctly demonstrates a lambda function that squares an input number 'x'?
  3. When using the 'map()' function to transform a list of strings into their integer lengths, which lambda is most appropriate?
  4. You have a list of dictionaries representing user data. Which approach using 'sort()' and a lambda would correctly sort the list by the 'age' key?
  5. What is the result of executing the following code: list(filter(lambda x: x % 3 == 0, range(1, 10)))?

Answers and explanations come after you submit.