Machines · difficulty 2 of 3
Vending machine 🥤
Process commands from the input box: coin N adds N pence, select CODE dispenses if there is enough credit and stock (printing the change), cancel refunds credit. Print exactly the messages shown in the hint.
Write it in the browser and press run. Real Python, checked against the expected output, no account needed.
Skills: dicts, if/else, loops