Skip to content
>_
LearnPy Hub
☰ Menu
Learn
Practice
Compiler
Arena
Contest
About
◐
← Loops problems
Easy
Sum from 1 to N
Print the sum 1 + 2 + … + N using a loop.
Input
One integer N ≥ 1.
Output
The sum.
Sample 1
Input
5
Output
15
Sample 2
Input
1
Output
1
solution.py
☀ Light
Clear
▶ Run
▶ Run samples
Submit
Output appears here
Hints
Show hint 1 of 1
Sum from 1 to N · Python practice problem · LearnPy Hub