Jed Rembold
March 13, 2026

What would the code to the left print off?
246A = (1, 2, (3, 4))
B = A[1::2]
x, y, z = A
for i in range(x):
B += z
print(y * B[-2])
positions.py exports a single
constant called KAREL_POS, which is a
list of tuples, recording what street and avenue
intersection Karel is located at different elapsed times
None
here, since we don’t know what the next position isKAREL_POS = [
(0, 4, 3),
(1, 4, 3),
(2, 3, 3),
(3, 0, 2),
(4, 0, 2)
]
KAREL_POS = [
(0, 4, 3, False),
(1, 4, 3, True),
(2, 3, 3, True),
(3, 0, 2, False),
(4, 0, 2, None)
]