Skip to content

Commit 279c001

Browse files
authored
Added break continue pass statements
1 parent 1016516 commit 279c001

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# break
2+
"""
3+
Break keyword is used to break out of for loop for while loop
4+
Break statement in python terminates the current loop and resumes execution at the next statement
5+
"""
6+
n = 'guna'
7+
for i in n:
8+
if i == 'u':
9+
print(i)
10+
break
11+
12+
# Continue statement instruct a loop to continue to the next iteration
13+
for i in range(1, 20):
14+
if i == 3:
15+
print(i)
16+
continue
17+
18+
# pass statement is a null operations, nothing happens when it executes
19+
for i in range(1, 10):
20+
pass

0 commit comments

Comments
 (0)