Python Practice › Loop Programs › Program 71

Sum of the first 10 numbers with while

EasyLoop Programs · 71 of 90

Write a Python program to find the sum of the first 10 natural numbers using a while loop.

Advertisement
Output
55

Approach

  1. Add a counter to a total until it passes 10.

Solution

Python
i, total = 1, 0while i <= 10:    total += i    i += 1print(total)
Output
55

Learn the concept

New to this topic? Read the lesson, then come back.

More loop programs

← All 90 Loop Programs

Leave a Comment