Python Program To Print Numbers From 1 to 10 Using While Loop

Problem Definition

Create a Python program to print numbers from 1 to 10 using a while loop.

Solution

In programming, Loops are used to repeat a block of code until a specific condition is met. The While loop loops through a block of code as long as a specified condition is true.

To Learn more about working of While Loops read:

Program

i = 1
while(i<=10):
    print(i)
    i += 1

Output

1
2
3
4
5
6
7
8
9
10

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Close