Python Tutorials - Herong's Tutorial Examples - v2.15, by Herong Yang
"pass" Statement - Do Nothing Statement
This section provides a quick introduction of 'null' statement, which does nothing, and is commonly used used as a placeholder to form an empty sub-statement block.
What Is "pass" Statement? A "pass" statement is a simple statement that does nothing. a single expression.
A "pass" statement has the keyword "pass" as the entire statement. For example, the following code shows a "pass" statement:
>>> pass >>>
The "pass" statements are mostly used in "def" and "class" compound statements as placeholders for their required sub-statement blocks.
For example, the following code defines a null function and a null class:
>>> def null_function(): ... pass >>> class null_class: ... pass >>>
Table of Contents
Variables, Operations and Expressions
►"pass" Statement - Do Nothing Statement
Expression Statement - One Expression Only
"=" Statement - Assignment Statement
"del" Statement - Delete Statement
"import" Statement to Load Modules
"if" Statement for Conditional Execution
"while" Statement for Execution Loop
"for" Statement for Iterative Execution
"try" Statement to Catch Execution
"with" Statement for Context Manager
"match" Statement for Pattern Match
Function Statement and Function Call
List, Set and Dictionary Comprehensions
Packages and Package Directories
"pathlib" - Object-Oriented Filesystem Paths
"pip" - Package Installer for Python
SciPy.org - Python Libraries for Science
pandas - Data Analysis and Manipulation
Anaconda - Python Environment Manager