Lambda Transformations Quiz

5 questions Pass: 70% +25 pts

Quiz covering Data Transformation

Lambda Transformations Quiz

5 questions | Pass: 70% | Earn 25 points

Questions in this quiz

A preview of the 5 questions covered. Start the quiz above to answer them, check your score, and read the explanations.

  1. 1

    In Python, what is the primary purpose of a lambda function?

  2. 2

    Which of the following syntax examples correctly demonstrates a lambda function that squares an input number 'x'?

  3. 3

    When using the 'map()' function to transform a list of strings into their integer lengths, which lambda is most appropriate?

  4. 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. 5

    What is the result of executing the following code: list(filter(lambda x: x % 3 == 0, range(1, 10)))?