Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

How to Format Your List Comprehensions

Give Feedback

List comprehensions and comprehensions in general can get very long and go over the recommended line length. This lesson showed a couple of ways to break list comprehensions and write them over multiple lines without sacrificing their readability.

The next lessons will talk about the dangers or pitfalls to avoid when working with list comprehensions and when you should choose not to use them at all.

Resources

Comments & Discussion

Anonymous on March 14, 2019

where is the links as mentioned in Vedio ?

Dan Bader RP Team on March 14, 2019

Ah, I added the link on the course description and not on the video at first. Here it is: Comprehending Python’s Comprehensions

Become a Member to join the conversation.