🧩Keyword
Also known as Reserved Word
A word the language keeps for itself, like if or return. You cannot reuse it.
Think of it like
Think of it like the words on road signs. Stop and Go mean one thing only, so nobody may use them as a name.
Example
Emma tries to name a variable class in Python. Python stops her, because class is a keyword.
Why it matters
Keywords are the skeleton of every program. Knowing the short list makes any code easier to read.
Definition
Example code
python
>>> import keyword
>>> keyword.iskeyword("while")
True
>>> keyword.iskeyword("apple")
FalseCommon mistake
Key takeaways
- 1Fixed meaning. Each keyword does one job in the language.
- 2Not for names. You cannot call your own things by them.
- 3Short list. Most languages have only a few dozen.