# PURPOSE: to calculate the sum of the first (n) counting numbers
#
# INPUT(S): the number (n) which will be the last number added to the sum
#
# OUTPUT(S): the sum of the first (n) counting numbers
#
# EXAMPLES: input: 4 ; output: 10
# input: 8 ; output: 36
#
###########################################
import math
def sums(n):
sum = 0
for i in range(0, i + 1, 1):
sum = sum + i
return sum
def main():
n = input('Enter a number: ')
while n < (n + 1):
s = sums(n)
while n == (n + 1):
break
print 'The sum of the numbers is', s
()
i keep getting an error saying that 'i' was referenced before assignment and i'm not exactly sure where to go from here. any help is appreciated, thanks.