-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhile loop.txt
More file actions
36 lines (31 loc) · 780 Bytes
/
while loop.txt
File metadata and controls
36 lines (31 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
loop
which is used to repetatonof statement
there are two type of loop in python
while loop
for loop
while loop
i=1 #initialization
while i<=10:#condition
print("manu")
i+=1#increment/decreament
nested while loop
i=1 #initialization
j=1 #initialization
while i<=10:#condition
print("manu")
while j<3:
print("gadha")
j+=1
i+=1#increment/decreament
j=1
by default print move cursor into newline if you want to print next statement on same line you can use end= " "
i=1 #initialization
j=1 #initialization
while i<=10:#condition
print("manu",end=" ")
while j<3:
print("gadha",end="")
j+=1
i+=1#increment/decreament
j=1
print("\n")