code:-

num = int(input("Input a number: "))
sum_num = (num * (num + 1)) / 2
print(sum_num)
output:-

Input a number: 12
78.0
>>> 

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post