Scope is about assignment, not mutation PREMIUM

Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
2 minute read Python 3.7—3.10

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.