Wednesday, December 14, 2016

Python:Loops

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, .

Output Format
Print lines, one corresponding to each .
Sample Input
5
Sample Output
0
1
4
9
16
 
Python 2.0 Code:
 
a=int(raw_input())
i=0
while i<a:
   print pow(i,2)
   i+=1