List Comprehension

Now that we are done with lists, let's have a look at list comprehension.

We'll cover the following

List Comprehensions

List comprehensions are a concise way to create lists. They consist of square brackets containing an expression followed by the for keyword; the result will be a list whose results match the expression.

The general syntax is:

Get hands-on with 1200+ tech skills courses.