-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay16.py
More file actions
32 lines (27 loc) · 915 Bytes
/
Day16.py
File metadata and controls
32 lines (27 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import warnings
from Day15.coffee_machine_art import coffee_machine_logo
from coffee_maker import CoffeeMaker
from menu import Menu
from money_machine import MoneyMachine
money_machine = MoneyMachine()
coffee_maker = CoffeeMaker()
menu = Menu()
with warnings.catch_warnings():
warnings.simplefilter('ignore', SyntaxWarning)
warnings.warn('bad', SyntaxWarning)
is_on = True
print("Day 16 - 100 Days of Code.")
print("Welcome to Coffee Machine.")
print(coffee_machine_logo)
while is_on:
options = menu.get_items()
choice = input(f"What would you like? ({options}): ")
if choice == "off":
is_on = False
elif choice == "report":
coffee_maker.report()
money_machine.report()
else:
drink = menu.find_drink(choice)
if coffee_maker.is_resource_sufficient(drink) and money_machine.make_payment(drink.cost):
coffee_maker.make_coffee(drink)