Levels 1–3 · Debug
Fix range boundaries, type conversion, and comparison logic.
Ten progressive coding challenges across the Python syllabus
Python Challenge · 10 progressive levels
Work through ten short levels aligned with Units 1–5. Each level begins with editable Python, a clear objective, and an optional hint. Run your code to check its output. Passing a level unlocks the next one, and your completed levels and XP are saved in this browser.
0/10
levels completed
0
XP earned
175
XP available
Level 1 · Unit 2 · Control flow
Debug · off-by-one · 10 XP
Your task
The loop should print 1, 2, 3, and 4. Fix the range so the final value appears.
Edit the starter code below, run it, and compare the result with the goal.
# Fix the endpoint so the loop includes 4.
for number in range(1, 4):
print(number)Output
Your program's output will appear here.
NameError: name 'mark' is not defined
NameError: A name was used before Python could find a variable or function with that name.
IndexError: list index out of range
IndexError: The requested position is outside the items in this list or sequence.
KeyError: 'email'
KeyError: That key does not exist in this dictionary.
TypeError: can only concatenate str (not "int") to str
TypeError: This operation does not work with the kind of value it received.
ZeroDivisionError: division by zero
ZeroDivisionError: A number cannot be divided by zero.
SyntaxError: invalid syntax
SyntaxError: Python could not understand the structure of this line. Check spelling, brackets, colons, and quotes.
IndentationError: expected an indented block
IndentationError: The spaces at the start of a line do not match Python's block structure.
Fix range boundaries, type conversion, and comparison logic.
Use collections, string methods, functions, and recursion.
Apply imports, NumPy, and a small dictionary-based expense project.
Projects stay within the taught syllabus. The employee-management idea is represented with dictionaries; object-oriented classes are not required here.