Objective
Create a Python program that generates the squares of the first numbers with a list comprehension.
Instructions
- Read an integer
n. - Build with a list comprehension the list of the squares of the numbers from 1 to
n. - Show the list on a single line, with the values separated by a space.
5
1 4 9 16 25
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise