Comprehending comprehensions by Reuven M. Lerner

Comprehending comprehensions

Less Python code. More Python power.


Comprehensions — list, dict, and set — are a powerful Python feature that make your code shorter, more efficient, and more expressive. However, a large number of Python developers think of comprehensions as nothing more than "for" loops with a hard-to-understand syntax, and avoid using them. That's a shame, because comprehensions aren't that hard, and are quite useful for solving a wide variety of problems.

This course will explores comprehensions, starting with the basic syntax and use cases, working up to nested comprehensions that allow us to solve more complex problems. The course includes a large number of hands-on exercises, as well as an even larger number of live-coding demos.

By the time the course is over, you will no longer wonder when or how to use comprehensions. Instead, you'll know how, when, and why to use comprehensions, making you a more fluent Python developer. 

The course includes:
  • Nearly two hours of video
  • More than 15 exercises
  • PDFs of the slides I use to teach this subject
  • Files used for exercises
  • The Jupyter notebook from my on-screen lectures

If you are a Python developer, and haven't yet figured out how, when, or when to use comprehensions, then this course is for you.  It'll allow you to do more in less time, and with less code.  It'll help you to tap into one of Python's most powerful tools, and understand code that others have written.

What's included?

Video Icon 22 videos File Icon 10 files


Section 1: Introduction
01 Intro and
3 mins
02 What is functional programming?.mov
13 mins
Section 2: List comprehensions
03 Intro to comprehensions.mp4
12 mins
04 Basic comprehension exercises.mp4
4 mins
406 Bytes
05 Basic comprehension exercise solutions.mp4
6 mins
06 More complex list comprehensions.mp4
10 mins
769 Bytes
07 Complex comprehension exercises.mp4
5 mins
08 Complex comprehension exercise solutions.mp4
9 mins
08a Complex comprehension exercise 4 solution.mp4
4 mins
Section 3: Set comprehensions
09 Set comprehensions.mp4
7 mins
10 Set comprehension exercises.mp4
2 mins
286 Bytes
11 Set comprehension exercise solutions.mp4
6 mins
Section 4: Dict comprehensions
12 Dict comprehensions.mp4
6 mins
13 Dict comprehension exercises.mp4
4 mins
1.04 KB
14 Dict comprehension exercise solutions.mp4
8 mins
Section 5: Nested comprehensions
15 Nested comprehensions.mp4
7 mins
16 Nested comprehension exercises.mp4
4 mins
535 Bytes
17 Nested comprehension exercise solutions.mp4
5 mins
Section 6: Shoe store exercise
18 Shoe store exercise.mp4
2 mins
241 Bytes
19 Shoe store exercise solution.mp4
8 mins
Section 7: Conclusion
20 Who cares?.mp4
5 mins
2 mins
Section 8: Supporting files
Comprehending comprehensions.pdf
1010 KB
6 KB
737 KB
Comprehending comprehensions.ipynb
69.7 KB

Because better developers have better careers

Have a more satisfying, successful, and lucrative career, by becoming more fluent in Python, Git, and related technologies.