Python Program to Print First 10 Odd Natural Numbers

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

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

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

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

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

while(i <= 10):
    print(2 * i - 1)
    i = i + 1
====The First 10 Odd Natural Numbers====
1
3
5
7
9
11
13
15
17
19

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.