LearnPy Hub
← Loops problems
Easy

Sum 1 to n

Read n and print 1 + 2 + … + n using a loop.

Input

One integer n ≥ 1.

Output

One integer.

Sample 1

Input
5
Output
15

Sample 2

Input
1
Output
1
solution.py
Output appears here
Sum 1 to n · Python practice problem · LearnPy Hub