by BlastRoom
Practice finding the failing line, error class, and cause in Python tracebacks.
#computer_science

20 questions
One question set, multiple game modes. Tap any game to see it in action. Not sure which to pick?
Answer to place stones and capture territory.
Outrun the snow together.
Earn blasts, then hunt the other team.
Answer to earn energy, then climb.

The class blasts through walls together.
Bid on mystery lots. Most money wins.
Sell tours. Nice, standard, or a total scam.
Answer, restock, and serve the rush.
More correct answers pulls the rope your way.
Answer, then shoot down the alien wave.
Answer, then tap to leap the frozen ridge.
Program: 1 def half(n): 2 return n / 0 3 print(half(6)) Traceback (most recent call last): File "a.py", line 3, in File "a.py", line 2, in half ZeroDivisionError: division by zero Which line did the failing operation?
1 def last_item(words): 2 return words[3] 3 print(last_item(["sun", "moon"])) Traceback (most recent call last): File "b.py", line 3, in File "b.py", line 2, in last_item IndexError: list index out of range Which line used an invalid index?
Program: 1 def score_for(scores, name): 2 return scores[name] 3 print(score_for({"Ava": 9}, "Ben")) Traceback (most recent call last): File "c.py", line 3, in File "c.py", line 2, in score_for KeyError: 'Ben' Which line failed?
Program: 1 def label(text): 2 return text + 1 3 print(label("Level ")) Traceback (most recent call last): File "d.py", line 3, in File "d.py", line 2, in label TypeError: can only concatenate str (not "int") to str Which line failed?
Program: 1 def record(items): 2 items.add("new") 3 record([]) Traceback (most recent call last): File "e.py", line 3, in File "e.py", line 2, in record AttributeError: 'list' object has no attribute 'add' Which line caused the error?
The error class at the end of this traceback is hidden. Traceback (most recent call last): File "grades.py", line 5, in print(total) _____: name 'total' is not defined Which error class stopped the program?
The error class at the end of this traceback is hidden. Traceback (most recent call last): File "items.py", line 4, in print(7[0]) _____: 'int' object is not subscriptable Which error class ended the run?
The error class at the end of this traceback is hidden. Traceback (most recent call last): File "list.py", line 2, in print(colors[4]) _____: list index out of range What error class stopped this program?
The error class at the end of this traceback is hidden. Traceback (most recent call last): File "teams.py", line 4, in print(roster["captain"]) _____: 'captain' Which error class stopped the program?
The last line of this traceback has been cut off. Traceback (most recent call last): File "maths.py", line 2, in print(12 / 0) Which error class stopped the program?
Traceback (most recent call last): File "hello.py", line 4, in greet() TypeError: greet() missing 1 required positional argument: 'name' What does this message mean?
Traceback (most recent call last): File "total.py", line 3, in print(4 + "5") TypeError: unsupported operand type(s) for +: 'int' and 'str' What caused this error?
Traceback (most recent call last): File "names.py", line 2, in print(names[2]) IndexError: list index out of range What does the final message tell you?
Traceback (most recent call last): File "colors.py", line 3, in print(colors["green"]) KeyError: 'green' What caused this error?
Traceback (most recent call last): File "average.py", line 5, in print(total / count) ZeroDivisionError: division by zero What does the traceback say about count?
This code produces IndexError: list index out of range. scores = [8, 5, 9] print(scores[3]) Which change lets the code run without any error?
This code produces NameError: name 'total' is not defined. points = [3, 4] print(total) Which change lets the code run without any error?
This code produces TypeError: can only concatenate str (not "int") to str. points = 12 print("Points: " + points) Which change lets the code run without any error?
Which function failed? Traceback (most recent call last): File "g.py", line 9, in run() File "g.py", line 6, in run score(7) File "g.py", line 3, in score print("Score: " + n) TypeError: can only concatenate str (not "int") to str
Which function failed? Traceback (most recent call last): File "s.py", line 9, in checkout() File "s.py", line 6, in checkout discount() File "s.py", line 3, in discount print(price / 0) ZeroDivisionError: division by zero
Crack the passcode before the zombies get in.
Answer, then swat bugs for bonus points.
Race through questions at your own speed.
Same question on every screen. Fastest wins.

Pick a tile, answer, hit bonuses and steals.
CSS Selectors, Properties and Styling
40 questions