Test Your Knowledge: Quiz

 

 
  1. What is the difference between enclosing a list comprehension in square brackets and parentheses?
  2. How are generators and iterators related?
  3. How can you tell if a function is a generator function?
  4. What does a yield statement do?
  5. How are map calls and list comprehensions related? Compare and contrast the two.