programming-examples/python/Basics/Sum of the first n positive integers.py
2019-11-18 14:44:36 +01:00

3 lines
85 B
Python

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