-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP21WhileLoopDemo.py
More file actions
62 lines (48 loc) · 788 Bytes
/
P21WhileLoopDemo.py
File metadata and controls
62 lines (48 loc) · 788 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""P.21 ITERATIVE STATMENTS
1. WHILE LOOP DEMO
"""
print("----------------------------")
print("""
P.21 ITERATIVE STATMENTS
1. WHILE LOOP
""")
i = 1
while i <100:
print(i)
i +=1
print("-------------------")
print("""Program Begins
i = 1
while i <100:
print(i)
i += 1
-------------------
Program Ends""")
print("INFINITE LOOP DEMO")
print(""""-------------------
CODE FOR INFINITE LOOP
i = 1
j= 1
while i <100:
print(j)
j = j +1
-------------------
""")
i = 1
j= 1
while i <100:
print(j)
i = i +1
print("---------------------------")
print("""NESTED WHILE LOOP DEMO
SAMPLE PROGRAM FOR NESTED WHILE LOOP
""")
i=5
j=6
k=1
while i>0:
while j>0:
print("HELLO from ",k)
k=k+1
j=j-1
i=i-1