Skip to content

Commit cbc2647

Browse files
committed
loop_control_statement.py
1 parent d045b7a commit cbc2647

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

loop_control_statement.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
count=1
2+
while count<=10:
3+
print(count)
4+
count+=1
5+
if count==5:
6+
break
7+
else:
8+
print("Hi")
9+
print("out from block")
10+
11+
for i in range(1,10):
12+
print(i)
13+
i+=1
14+
if i==3:
15+
break
16+
else:
17+
print("Hi")
18+
print("Out from block")
19+
20+
list1=["hi","hello","welcome"]
21+
names=["Krishn","Ram","Madhav"]
22+
for item in list1:
23+
for name in names:
24+
print(item,name)
25+
if item=="hello" and name=="Ram":
26+
break
27+
print("Out From Inner Loop")
28+
print("Out From Inner Loop")

0 commit comments

Comments
 (0)