"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

 About This Book

 Running Python Code Online

 Python on macOS Computers

 Python on Linux Computers

 Built-in Data Types

 Variables, Operations and Expressions

Statements - Execution Units

 What Is Statement

"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

 Iterators and Generators

 List, Set and Dictionary Comprehensions

 Classes and Instances

 Modules and Module Files

 Packages and Package Directories

 "sys" and "os" Modules

 "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

 Jupyter Notebook and JupyterLab

 References

 Full Version in PDF/EPUB