- 1
How does it works?
no=int(input()) Sum=0 for n in range(no+1): Sum+=n print(Sum)
1 Answer
+ 2
What exactly do you mean? Which part is unclear to you?
The loop sums up all numbers from 0 to no and prints the result.
no=int(input()) Sum=0 for n in range(no+1): Sum+=n print(Sum)