Task
Read an integer . For all non-negative integers , print . See the sample for details.
Input Format
The first and only line contains the integer, .
Constraints
Output Format
Print  lines, one corresponding to each .
Loops problem solution | Python | HackerRank

Problem solution in python 2 programming language.

for i in range(int(raw_input())):
    print i**2

Problem solution in python 3 programming language.

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

Explanation of program code:

Here we use the for loop that will run from zero to n where n is the input that is given by the user. and it print the square of value i.