What is Break and Continue in python?

Break

File name : index.py


Continue

File name : index.py


Pass

the pass keyword is used to execute nothing; it means, when we don't want to execute code, the pass can be used to execute empty. It is the same as the name refers to. It just makes the control to pass by without executing any code. If we want to bypass any code pass statement can be used.

File name : index.php

values = {'P', 'y', 't', 'h','o','n'}
for val in values:
    pass

File name : index.py

for i in [1,2,3,4,5]:
     if(i==4):
     pass
     print("This is pass block",i)
     print(i)

Output :-

1
2
3
This is pass block 4
4
5





Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here