3.3 Syntax Errors
Lab 3.3.1
Identify the error
b=2
c=4
b/c
Lab 3.3.2
Identify the error in the code below:
a = 1
b = 2
if a > b
print("a is bigger than b")
elif a == b:
print("equal")
else:
print("a is smaller than b")
Lab 3.3.3
Identify the error
a = 1
b = 2
if a > b:
print("a is bigger than b")
elif a = b:
print("equal)
else:
print("a is smaller than b")
Lab 3.3.4
Identify the error
a = 1
b = 2
if a > b:
print("a is bigger than b")
elif a == b:
print("equal)
else:
print("a is smaller than b")
Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.