Skip to content

Nov 06: Comprehensions

Meet in EnGeo 2208

Learning Objectives

After today's class, you should be able to:

  • Explain the syntax and meaning of a list/set/dict comprehension.
  • Rewrite a short accumulation loop as a comprehension.
  • Describe when a comprehension is clearer than a loop.

Lesson Outline

Presentation [10 min]

  • Building a large dictionary by reading a file

Activity [40 min]

Your To-Do List