Python comprehensions are a very natural and easy way to create lists, dicts, and sets. They are also a great alternative to using maps and filters within python. If you are using maps, filters, or for loops to create your lists, then most likely you could and should be using comprehensions instead.
In this video, we will look at how comprehensions work, why you should be using them, and the benefits they have over the alternatives. Let’s get started.