Python Program to Print First 10 Natural Numbers

Write a Python program to print first 10 natural numbers using for loop.

print("====The First 10 Natural Numbers====")

for i in range(1, 11):
    print(i)
Python Program to Print First 10 Natural Numbers

This Python program displays the first 10 natural numbers using a while loop.

print("====The First 10 Natural Numbers====")
i = 1

while(i <= 10):
    print(i)
    i = i + 1
====The First 10 Natural Numbers====
1
2
3
4
5
6
7
8
9
10

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.