7. Sum of First N Natural Numbers

Acceptance — 0 accepted 0 submissions

Easy
No topics listed
No companies listed
Write a Python program that asks the user to enter a number N. Then calculate and print the sum of all natural numbers from 1 to N. The program must take N as input from the user.

Example 1

Input
1
Output
1

Explanation Sum of first 1 natural number is 1

Example 2

Input
5
Output
15

Explanation 1+2+3+4+5 = 15

Example 3

Input
10
Output
55

Explanation Sum of first 10 natural numbers is 55

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
1
No results yet
Run your code to test it against the sample cases.
Problem List