Find Mistake: Using a Keyword as Variable
Find the Mistake Easy
Question
This code has a syntax error. What is wrong?
Code
class = "Python 101"
Hint
Some words are reserved by Python.
Explanation
class is a reserved Python keyword and cannot be used as a variable name. The fix is to use a different name like course_name = 'Python 101' or class_name = 'Python 101'.
Related Resources
Related Lessons
- Python Variables
Variable naming rules.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.