“Yesterday you did a great job, Erik,” Simon said the next day. “You wrote a very good function, you added default arguments, and you tested it.”
“Oh, really? Let me try.” Simon looked like he had something in mind. He started Erik’s program again, and at the first menu he entered coffee:
Erik's drinks -------------------------------- 1 chocolate 2 coffee 3 decaf Choose your drink: coffee Traceback (most recent call last): #1 File "/home/erik/mu_code/menu_function.py", line 18, in <module> #1 drink = menu("Erik's drinks", drinks, "Choose your drink: ") #1 File "/home/erik/mu_code/menu_function.py", line 9, in menu #1 answer = choices[int(choice) - 1] #1 ValueError: invalid literal for int() with base 10: 'coffee' #1 >>> #1 Error messages from Python