0
Some what I'm missing in this problem.. Could you help me?Q:Read an integer N.. For all non negative integers i <N, print i**2.
#My code n = int(raw_input) i = 0 while i <20: i+=1 print(i**2) ""Output should come under 20, but i don't get it """
5 Réponses
+ 2
n = int(input())
i = 0
while i <n:
i+=1
print(i**2)
#raw input is python 2 vertion function,
In python 3, input()
SoloLearn supports python 3..
+ 1
when i enter 5.. Output is like 1,4,9,16,25....but is should be 0,1,4,9,16..
+ 1
Change the order like this
print(i**2)
i+=1
+ 1
Thanks bro.. Its working 😃😃😃
+ 1
SELVANITHISH SELVANITHISH
Observe and understand each line of code..
You're Wel come..