In this HackerRank Loops problem statement, we need to develop a python program that can take an integer input and print the square of that number till number < n on the output screen.

HackerRank Loops solution in Python


Problem solution in Python 2 programming.

n=int(input())
for i in range(n):
    print i**2


Problem solution in Python 3 programming.

if __name__ == '__main__':
    n = int(input())
    for i in range(0,n):
        print(i*i)


Problem solution in pypy programming.

# Enter your code here. Read input from STDIN. Print output to STDOUT

N = int(raw_input())

for i in range(0,N):
    print(i**2)


Problem solution in pypy3 programming.

# Enter your code here. Read input from STDIN. Print output to STDOUT

n = int(input())

for i in range(0,n):
    print(i*i)