Scope is about assignment, not mutation PREMIUM

Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
2 min. read 3 min. video Python 3.8—3.12

In Python, scope is about assignment; it's not about mutation.

Assignment and the scope of a variable

Let's take a global variable, numbers, that point to a list of numbers:

...

A Python Tip Every Week

Need to fill-in gaps in your Python skills? I send weekly emails designed to do just that.