Python Exercise 1 / 15

List Comprehensions and Generators

Hard 30 points

Create a list of squares of numbers from 1 to 5 using a list comprehension.

List comprehensions create lists concisely. [x**2 for x in range(1, 6)] creates [1, 4, 9, 16, 25]. This is powerful Pythonic syntax.

Well done! 🎉
Your answer is correct! You earned 30 points.
Your code Python
Result