LearnPy Hub
← Comprehensions problems
Medium

Number and Square Pairs

Read n and print a list of tuples (i, i*i) for the even numbers i from 2 to n, using one comprehension.

Input

One integer n ≥ 2.

Output

A Python list.

Sample 1

Input
10
Output
[(2, 4), (4, 16), (6, 36), (8, 64), (10, 100)]

Sample 2

Input
2
Output
[(2, 4)]
solution.py
Output appears here
Number and Square Pairs · Python practice problem · LearnPy Hub