Python Tutorials - Herong's Tutorial Examples
∟Variables, Operations and Expressions
This chapter provides introductions and tutorial examples about expressions. Topics include introductions to variables, operations and expressions; operation precedences and execution order.
What Is Variable
What Is Operation
What Is Expression
Conditional Expression - Ternary Operation
Assignment Expression - Walrus Operation
Takeaways:
- A variable is a symbolic name of a data object.
- A variable can also be considered as an storage
for a reference or a pointer to the object.
- An operation is a sequence of lexical tokens in Python source code
that invokes a predefined action on one or two data objects.
- An expression is a sequence of lexical tokens in Python source code
that expresses a single object, a single operation,
or multiple operations executed sequentially.
- Operations enclosed within parentheses are executed first.
- Operations with higher precedences are executed first.
- Operations on the left are executed first, if they
have the same precedence.
- An expression always produces an object.
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
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