I input 10 to the below sequence, the it prints sum = 56 I list what sum includes, they are 1,2,3,4,5,6,7,8,9,10. I wonder what's wrong with the calculation of sum.
=======================================
n = int(input('input number?'))
sum = 1
for i in range(1,n+1,1):
sum += i
print(sum)
sum = 0. Note: defaultstepsare 1 in Python loop, so the third param in the range is unnecessary.