In Python it's very common to build up new lists while looping over old lists. Partly this is because we don't mutate lists very often while looping over them.
Because we build up new lists from old ones so often, Python has a special syntax to help us with this very common operation: list comprehensions.
My name is Trey Hunner. I do corporate Python training for teams and I teach Python online through Python Morsels.
In Python Morsels, I publish a new Python screencast every week.
If you want to learn something new every week, join Python Morsels!Join Python Morsels ✨