Recently, we looked at list comprehensions in Python. Similar to its sibling the list comprehension, a dictionary comprehension is nothing more than a shorthand way of creating a new dictionary collection. While it may seem a little more complicated than the list version, it is actually quite simple to understand.
In this video tutorial from my course on Data Handling With Python, I'll show you exactly what dictionary comprehensions are and how you can use them.
Watch the Full Course
Do you want to learn Python in depth? If so, the full course, Data Handling With Python, is for you. It goes beyond the basics and takes you through Python data management in detail. Beyond comprehensions, we'll also look at map, filter, lambdas, and generators, as well as reading and writing to files and complex objects.
And if you want something even more comprehensive, try my seven-hour course Learn to Code With Python, which includes the lessons on data management but also covers a whole lot more aspects of the Python language.
Subscribe below and we’ll send you a weekly email summary of all new Code tutorials. Never miss out on learning about the next big thing.Update me weekly
Envato Tuts+ tutorials are translated into other languages by our community members—you can be involved too!Translate this post