Skills101
← All practice quizzes

Quiz: Comprehensions and Lambda

5 questionsNo time limitPass: 60%+10 XP on first pass

Write shorter, more Pythonic code. List comprehensions with a picture, lambda functions, map, filter, zip, any/all, and simple recursion.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What does [x * 2 for x in range(4)] give?

  2. Question 2

    What does [c for c in "hello" if c not in "aeiou"] give?

  3. Question 3

    What does list(map(len, ["a", "bb", "ccc"])) return?

  4. Question 4

    What is max(["kiwi", "banana", "fig"], key=len)?

  5. Question 5

    What is missing from a recursive function that causes a RecursionError?