Quick Recap
We'll cover the following...
We'll cover the following...
- We can’t use the “assignment expression” operator (a.k.a the walrus operator) at the top level without parenthesizing. Iterable unpacking isn’t supported either, so be careful when you see something like
(a := 6, 9). - String interning and constant folding are some of the optimizations implemented for strings to improve efficiency.
- Integers from
-5to256are pre-allocated in Python memory for faster access. Similar optimizations apply to other immutable objects, like empty tuples. - The interactive interpreters (like IPython) have certain differences in design (like more global variables, different compile units, etc.), which can lead to different execution behavior compared to the compiled Python files.
0 <= x <= 100is a more Pythonic way to write0 <= x and x <= 100. In general,a op1 b op2 c op3 d..is equivalent toa op1 b and b op2 c and c op2 d ...wherea,b,canddare any