# summing up all numbers from 0 to N, using a for loop

from number_check import *

# get N from the user, keep asking until an integer is entered
while True:
    my_string = input("please enter N: ")
    if (check_integer(my_string) == False):
        print("string", my_string, "is not a valid integer")
    else:
        break

N = int(my_string)

# compute the sum
total = 0
for i in range(0, N+1):
    total = total + i

print("The sum of numbers from 1 to", N, "is", total)
