Python - Decision control and looping statement - Pass Statement Tutorial
Pass statement is used to bypass the code or to execute nothing (empty/null). Suppose we have a function or loop that is not implement yet. But we want it to implement in future. Therfore, it cannot have empty body, otherwise it will give error. Hence, we use here a pass statement which will execute nothing.
Difference between comment and pass statement is, comment is fully ignored by python interpreter, while pass statement is not ignored by python interpreter.
# List of number
number = [4, 1, 2, 27, 25, 73]
# iterate over the list of number
for val in number:
Using Empty function
# Empty Function
Using Empty Class
Best learning portal that provides you great learning experience of various technologies with modern compilation tools and technique
Don't hesitate to give us a call or send us a contact form message