- 5
Can any one write for me the code to find the sum of consecutive numbers
N = int(input()) i = (range(N)) i+=1 while i in range(N): print (int(i))
3 Respostas
+ 3
N = int(input())
a = [i for i in range(0, N + 1)]
print(sum(a))
- 1
It's easier:
https://code.sololearn.com/ca7A25a19A20