Mastery check
Rep 1of 8 in this section
Learn~2 min
Trace: keep the table
Predict the output. Before you answer, write down what menu holds after every line.
menu = {}
menu['tea'] = 3
menu['cake'] = 5
menu['tea'] = 4
print(menu)
print(len(menu))
print('cake' in menu)
print(5 in menu)
print(menu['tea'] + menu['cake'])Reminder
Keep a running table: {} → {tea: 3} → {tea: 3, cake: 5} → {tea: 4, cake: 5}. Then answer each print from the table.
Predict the output