Python Program to print sum of first 10 natural numbers


In this program, You will learn how to print the sum of the first 10 natural numbers in Python.


55 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10

Example: How to print the sum of the first 10 natural numbers in Python.

s = 0
for x in range(1, 11):
    s = s + x

print("Sum of first 10 Natural Numbers is:", s)

Output:

Sum of first 10 Natural Numbers is: 55