Module 1
Your first errors
Common mistakes and how to read them.
Three common errors
As you write more code, you will encounter errors. Here are three common ones and what they mean.
PythonSyntaxError
# SyntaxError: missing closing quote
# print("DNA)→
PythonNameError
# NameError: variable not defined # print(sample)
→
PythonTypeError
# TypeError: wrong operation
# print("5" + 3)→
Why it matters
SyntaxError means Python cannot understand the structure. NameError means you used a variable that does not exist. TypeError means you tried to combine incompatible things.
What does a NameError usually mean?