- How to Setup a Zynq UltraScale+ Vivado Project and Run a C-Code Example Accessing an AXI Slave on the FPGA
- Python Decorators, A Beginners Guide (With Code Examples)
- Python := / Walrus Operator Explained in Simple Terms (With Code Snippets)
- How to install an Alternative C/C++ Compiler (GCC/Clang) on macOS (Apple Silicon Mac M1/M2/M3)
- Verilog Development on Apple Silicon Macs (M1/M2/M3) - A Step-by-Step Guide to Setting up Verilator, SystemC and GTKWave on macOS
Python Operator Precedence
The following order of operators from highest precedence (evaluated before others or most binding) to lowest precedence (evaluated after others or least binding) is respected in Python 3.10.
Operator | Description |
(expression ...) , [expression ...] , {key: value ...} , {expression ...} | Binding or parenthesized expression, list display, dictionary display, set display |
x[index] , x[index:index] , x(arguments...) , x.attribute | Subscription, slicing, call, attribute reference |
await x | Await expression |
** | Exponentiation |
+x , -x , ~x | Positive, negative, bitwise NOT |
* , @ , / , // , % | Multiplication, matrix multiplication, division, floor, division, remainder |
+ , - | Addition and subtraction |
<< , >> | Shifts |
& | Bitwise AND |
^ | Bitwise XOR |
| | Bitwise OR |
in , not in , is , is not , < , <= , > , >= , != , == | Comparisons, including membership tests and identity tests |
not x | Boolean NOT |
and | Boolean AND |
or | Boolean OR |
if elif else | Conditional expression |
lambda | Lambda expression |
:= | Assignment expression |
Table taken from 6.17 Operator Precedence