So my problem is that this program should take inputted numbers (e.g 5
) would be 0+1+2+3+4
and the sum would be 10
. I have gotten it to list these numbers but how do I make this code to count them?
num1 = int(input("How many laps?: "))
num2 = int(0)
for lap in range (num1):
num2 = lap
print("Sum is:" , (num2))