Visitar URL original
basic of while loop · VenkatAdd/PythonScript@aad2fcd · GitHub
Skip to content

Commit aad2fcd

Browse files
committed
basic of while loop
1 parent 7883d33 commit aad2fcd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎Loops/4.WhileLoop.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#simlar to for loop while loop is used for iterbale object
2+
#while loop run block of code untill condtion is true when condition is false it will terminate execution of code block
3+
4+
#Syntax
5+
# while condition:
6+
# code of while block
7+
8+
9+
# simple example to print 1 to 10 numbers using while loop
10+
num=0
11+
while num<11:
12+
print(num)
13+
num=num+1
14+
15+
16+
#while block run until num is less than 11 means 0 to 10 numbers printed

0 commit comments

Comments
 (0)