0
Intro Python: Sum of Consecutive Numbers
N = int(input()) #your code goes here total = 0 for i in range(1,N+1): total = total + N print(total) It gives an output, just not the right one. What did I forget?
3 odpowiedzi
+ 3
At the moment you add N time the number N to total. What you actually want to do is adding the number i to total instead of N
0
Lisa ❤️🧡💛💚 Thank you.
0
Welcome! Great that you could fix your code! 👍