Walrus & Conditional Logic

Lab Python Intermediate 20 points

Read a line of integers. Using a list comprehension with the walrus operator, keep the values whose square is greater than 20, storing each square only once; print the squares.

Input

One line of integers.

Output

One line.

Example

Input

1 5 -6 3 10

Output

25 36 100
Sample input available Sample output available
Editor
Python

Hints

(name := expression) assigns and returns a value inside an expression.

Solution explanation

The walrus operator avoids computing x * x twice.

Show solution
nums = map(int, input().split())
print(*[sq for x in nums if (sq := x * x) > 20])
Output
Answer
HOME LEARN COMMUNITY DASHBOARD