Codington
0 of 6 problems solved • 0%

Exercise prompt

Predict the Route Total

A route appears twice in a trip log. Follow the balance stored under each route as the loop progresses.

Predict the output

What total is printed for route B?

trips = [("B", 3), ("A", 8), ("B", 2)] totals = {} for route, km in trips: totals[route] = totals.get(route, 0) + km print(totals["B"])
What will this code print?