Description:
Generate a list of squares from 1 to 10 using list comprehension.
Generate a list of squares from 1 to 10 using list comprehension.
Python Code
squares = [x**2 for x in range(1, 11)]
print(squares)
Expected Output
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]