Squares with a Comprehension

Lab Python Beginner 10 points

Read n and print the list of squares of 1..n built with a list comprehension.

Input

One integer.

Output

The list.

Example

Input

5

Output

[1, 4, 9, 16, 25]
Sample input available Sample output available
Editor
Python

Hints

[expression for item in iterable] builds a list.

Solution explanation

A comprehension is a compact loop that produces a list.

Show solution
n = int(input())
print([i * i for i in range(1, n + 1)])
Output
Answer
HOME LEARN COMMUNITY DASHBOARD