LearnPy Hub
← Comprehensions problems
Easy

Squares of 1 to n

Read n and print the list of squares of 1 to n using a comprehension over range().

Input

One integer n ≥ 1.

Output

A Python list.

Sample 1

Input
5
Output
[1, 4, 9, 16, 25]

Sample 2

Input
1
Output
[1]
solution.py
Output appears here
Squares of 1 to n · Python practice problem · LearnPy Hub