The pass statement in python is used
when a statement is required syntactically but you do not want any command or
code to execute.
The pass statement is a null
operation; nothing happens when it executes.
Example:
#!/usr/bin/python
For letter in ‘Python’:
If letter == ‘h’:
Pass
Print ‘This is pass block’
Print ‘Current
Letter:’, letter
Print “Good bye!”
This will produce following result:
Current Letter : P
Current Letter : y
Current Letter : t
This is pass block
Current Letter : h
Current Letter : o
Current Letter : n
Good bye!
No comments:
Post a Comment