Days and sales at the same position

Predict the output · Basic · §2.1 Matplotlib and setup

A bakery's loaf sales by day are stored in two separate lists. The values at the same position are the record for the same day. Write what the code prints when it runs.

Code

days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
loaves = [42, 38, 66, 51, 47, 59]

print(len(days), len(loaves))
peak = loaves.index(max(loaves))
print(peak, days[peak], loaves[peak])
print(days[peak + 1], loaves[peak + 1] - loaves[peak])

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.