I'm trying to write a function where the user gives the start and end of a range and the output is that range summed. This is my best try:
def sum_range (start, end):
output = 0
userange = range(start, end)
for i in userange :
sum(i, output)
return output
I get the following error:
TypeError: 'int' object is not iterable