0
Adding consecutive numbers. Can anyone help with this code .
N = int(input()) #your code goes here i=1 while i<N: i+=1 sum=i+N print(sum)
11 Answers
+ 2
N=int(input ())
sum=0
for i in range(1, N+1) :
sum=sum+i
print(sum)
0
This worked
0
How is iteration happening in your code.?
0
But there is no iteration happening, the value is going to change once, isnt it?