Skip to main content

Chapter 64 Quiz

Before taking the quiz, verify that you can do each of these without looking at the lessons:

  • Write a list comprehension with filter and transformation
  • Write a dict comprehension to build a lookup table
  • Write a set comprehension to extract unique values
  • Write a generator function with yield and explain lazy evaluation
  • Use sorted() with key= and a lambda to sort by custom criteria
  • Explain when to use map()/filter() vs comprehensions
  • Apply @lru_cache and read cache_info() output
  • Use functools.partial to create specialized function variants

If any feel uncertain, revisit the specific lesson before continuing.

Test your understanding of comprehensions, generators, and functional tools by evaluating data transformation patterns, predicting output, and choosing the right tool for each scenario.

Checking access...