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

When to Use List Comprehensions

Give Feedback

This lesson wraps up the course on list lomprehensions with a word of warning. Comprehensions are a powerful feature of Python but they can lead to unreadable code when overused or when poorly formatted.

You learned when not to use list comprehensions and also what strategies you can apply to help you decide when to use them.

Resources

Comments & Discussion

Eribertt on March 12, 2019

Good presentation of list comprehension, helped me a lot understand the concept and the execution sequence.

Dan Bader RP Team on March 13, 2019

Thanks Eriberto, that’s great to hear! We’ve got some more list comprehension tips in our upcoming Python Interview Tips article.

The Python Tricks book also has a chapter on them if you’re looking to dig deeper :)

Become a Member to join the conversation.