Explain the use of pass statement. Illustrate it with an examples
Answers
Answered by
6
Python Pass Example. It is used when the statement is required syntactically, but you do not want that code to execute. The pass statement is the null operation; nothing happens when it runs. The pass statement is also useful in scenarios where your code will eventually go but has not been entirely written yet.
Answered by
5
Answer:
Definition and Usage
Explanation:
The pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when empty code is not allowed. Empty code is not allowed in loops, function definitions, class definitions, or in if statements.
Similar questions