Reserved words in Python PREMIUM

Trey Hunner smiling in a t-shirt against a yellow wall
Trey Hunner
3 min. read 2 min. video Python 3.8—3.12
Python Morsels
Watch as video
02:23

Let's talk about Python's keywords (not to be confused with keyword arguments).

Reserved words cannot be used as variable names

A reserved word (a.k.a. a keyword) is a word that cannot be used as a variable name.

For example, we can't use class as a variable, because class is reserved:

...

A Python Tip Every Week

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

Python Morsels
Watch as video
02:23