Problem: Loops in python
The provided code stub reads and integer,n , from STDIN. For all non-negative integers i<n, print i^2.
The list of non-negative integers that are less than n=3 is [0,1,2] is . Print the square of each number on a separate line.
0 1 4
The first and only line contains the integer, n.
Print n lines, one corresponding to each i.
Sample Input 0
Sample Output 0
0 1 4 9 16
if __name__ == '__main__': n = int(input()) for i in range(n): print(i*i)
Disclaimer: This problem is originally created and published by HackerRank, we only provide solutions to this problem. Hence, doesn’t guarantee the truthfulness of the problem. This is only for information purposes.