VARIABLE TRAPS
OPERATORS & MATH
STRING SLIP-UPS
DATA TYPES & BOOLEANS
SYNTAX & OUTPUT
100

123var = "hello"

What is starting a variable name with a number? (Variable names cannot begin with digits)

100

x = 2 ^ 3

 What is using ^ for exponentiation? (In Python, ^ is the bitwise XOR operator. Exponentiation uses a double asterisk **).

100

print("Hello)

What is a missing closing quotation mark? (The string opens with a double quote ", but never closes).

100

is_active = true

What is using a lowercase true instead of capital True? (Python booleans are case-sensitive and must start with a capital letter: True or False).

100

 print("Hello World"

What is a missing closing parenthesis )? (Every open parenthesis must have a matching closing one).

200

my age = 20

 What is a space in the variable name (my age)? (Variable names cannot contain spaces; use underscores like my_age).

200

x++

What is trying to use a non-existent increment operator (++)? 

need to use x += 1 or x = x + 1 instead.

200

print('It's sunny')

What is an unclosed string due to conflicting single quotes? ('It's' breaks because the single quote inside 'It's' prematurely closes the string).

200

x = "10" + 5

What is a TypeError trying to add a string and an integer ("10" + 5)? (Python won't implicitly add strings and numbers together).

200

if x == 5:

print(x)

What is a missing indentation (IndentationError)? (Python requires blocks after colons like if statements to be indented).

300

age = 15

print(Age)

 What is a NameError due to case sensitivity? (Age has a capital 'A', but the variable was defined as lowercase age)

300

if x = 5:

What is using the assignment operator = instead of the comparison operator == in an if statement? (= assigns values, == compares them).

300

message = "Score: " + 100

What is a TypeError (concatenating a string and an integer)? (You cannot use + to join a string and an integer directly; you must wrap the number in str(100)).

300

my_list = [1, 2]<br>print(my_list.length)

What is using .length instead of the len() function? (Python lists don't have a .length property; you use len(my_list)).

300

print("A" + print("B"))

What is trying to concatenate with print() which returns None? (print("B") prints to the console and returns None, which cannot be added to string "A").

400

5 = x

What is assigning to a literal value (5 = x)? (You can't assign a variable to a number; the variable name must always be on the left side: x = 5).

400

x = 10 % 0

What is a ZeroDivisionError with the modulus operator (10 % 0)? (Just like division, dividing or finding the remainder with zero is illegal).

400

print("C:\newfolder")

What is an accidental escape character (\n)? (\n inside "C:\newfolder" is interpreted as a newline. Solution: use a raw string r"C:\newfolder")

400

x = int("hello")

What is a ValueError during type casting? (int("hello") fails because "hello" cannot be converted into a valid integer number).

400

for i in range(5)

print(i)

What is a missing colon : at the end of the for statement? (Control flow statements like for, if, and while must end with a colon).

500

global = "test"

What is using a reserved keyword (global) as a variable name? (Keywords built into Python like global, for, if, class cannot be used as variable names).

500

result = (5 + 3

What is an unmatched parenthesis (5 + 3? (Missing a closing parenthesis ) to finish the math expression).

500

text = "Hello

world"

What is an unterminated multi-line string? (A string spanning multiple lines needs triple quotes """ or ''', or line-continuation backslashes.)

500

if 5 > 3 and:

What is an incomplete logical expression after and? (Logical operators like and or or must have a condition on both sides).

500

x = 10

y = 0

print(x / y)

What is a ZeroDivisionError? (Dividing any number by 0 crashes the program).

M
e
n
u