I'm trying to make a program that would for example if the user inputs the number 10, it would break it into 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and add all those numbers. My current code is as follows:
x = int(input('Enter a number: '))
for x in range(1,x+1,1):
print(sum(x))
This is giving me "TypeError: 'int' object is not iterable"
Any help would be appreciated