Skip to main content

Python While Loop

 While Loop:  It checks the while condition, if condition is true then while statements are executed repeatedly up to the condition is false, otherwise terminating the while.

Syntax:

            while(condition):

                        #statements

Program:

a=10

while(a<=15):

    print(a)

    a=a+1

Output:

10

11

12

13

14

15

Comments