Python pass keyword
Definition and Usage
The pass statement is used as a placeholder for future code.
Nothing happens when the pass statement is executed, but it can prevent errors from occurring in situations where empty code is not allowed.
Empty code is not allowed in loops, function definitions, class definitions, or if statements.
More Examples
Example 1
Using the pass keyword in function definition:
def myfunction: pass
Example 2
Using the pass keyword in class definition:
class Person: pass
Example 3
Using the pass keyword in if statements:
a = 33 b = 200 if b > a: pass