We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Introduction
- Loops
- Discussions
Loops
Loops
Sort by
recency
|
1777 Discussions
|
Please Login in order to post a comment
n = int(input())
for i in range(0,n): print(i*i) i = i + 1
n = int(input()) i= 0 while i
n = int(input())
for i in range(0,n): sq = i*i print(sq) i += 1
The provided code stub reads an integer, , from STDIN. For all non-negative integers , print .
Example n=3 The list of non-negative integers that are less than is . Print the square of each number on a separate line.
0 1 4
if name == 'main': n = int(input()) for i in range(n): print(i*i)