number = int(input())
s = 0
for i in range(1, number + 1):
s += i
print(s)
Ну или так:
summ = (1 + number) * number / 2
print(summ)
number = int(input())
s = 0
for i in range(1, number + 1):
s += i
print(s)
Ну или так:
number = int(input())
summ = (1 + number) * number / 2
print(summ)