[Solved] The Sum of Consecutive Numbers in Python


You should calculate consecutive numbers in dedicated variable

Try this

limit = int(input("Limit:"))
base = 0
number = 1
while base < limit:
    base += number
    number += 1
print(base)

2

solved The Sum of Consecutive Numbers in Python