Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fruits = []
- meats = []
- dairy = []
- vegetables = []
- sauces = []
- sweets = []
- class bcolors:
- HEADER = '\033[95m'
- OKBLUE = '\033[94m'
- OKGREEN = '\033[92m'
- WARNING = '\033[93m'
- FAIL = '\033[91m'
- ENDC = '\033[0m'
- BOLD = '\033[1m'
- UNDERLINE = '\033[4m'
- # should add option to add nothing to each category
- # should restrict total # of items to limited amount
- # should add budget, each item costs certain amount
- # should print list of recipes you can make with added items.
- print(":::Your fridge is empty.:::\n")
- def show_fridge():
- """Shows contents of all types currently in the fridge."""
- print(f"\n{bcolors.BOLD}:::::Here's everything in the fridge:::::{bcolors.ENDC}")
- print(f"\n{bcolors.OKBLUE}:::Fruits:::{bcolors.ENDC}")
- for fruit in fruits:
- print(fruit.title())
- print(f"\n{bcolors.OKBLUE}:::Vegetables:::{bcolors.ENDC}")
- for vegetable in vegetables:
- print(vegetable.title())
- print(f"\n{bcolors.OKBLUE}:::Meats:::{bcolors.ENDC}")
- for meat in meats:
- print(meat.title())
- print(f"\n{bcolors.OKBLUE}:::Dairy:::{bcolors.ENDC}")
- for dair in dairy:
- print(dair.title())
- print(f"\n{bcolors.OKBLUE}:::Sauces:::{bcolors.ENDC}")
- for sauce in sauces:
- print(sauce.title())
- print(f"\n{bcolors.OKBLUE}:::Sweets:::{bcolors.ENDC}")
- for sweet in sweets:
- print(sweet.title())
- def add_something_fridge(list_fruit, list_meat, list_veg, list_dairy, list_sauce, list_sweet):
- condition = True
- while condition:
- food_choice = input(
- "Please specify the food category you'll be storing in the fridge from the following options:\n"
- "[F] for fruits\n"
- "[M] for meats\n"
- "[V] for vegetables\n"
- "[D] for dairy\n"
- "[S] for sauces\n"
- "[C] for candies & sweets\n"
- "[Q] to exit\nSpecify here: ")
- a_list = []
- specifier = ''
- if food_choice.upper() == 'Q':
- break
- if food_choice.upper() == 'F':
- specifier = 'fruits'
- a_list = list_fruit
- elif food_choice.upper() == 'M':
- specifier = 'meat'
- a_list = list_meat
- elif food_choice.upper() == 'V':
- specifier = 'vegetables'
- a_list = list_veg
- elif food_choice.upper() == 'D':
- specifier = 'dairy products'
- a_list = list_dairy
- elif food_choice.upper() == 'S':
- specifier = 'sauces'
- a_list = list_sauce
- elif food_choice.upper() == 'C':
- specifier = 'sweets'
- a_list = list_sweet
- else:
- print(f'Sorry but {food_choice} is not one of the avaliable choices. Please try again.')
- while condition:
- desired_product = input(f"What {specifier} would you like to add?: ")
- a_list.append(desired_product)
- answer = input(f"[Y/N] Would you like to add more {specifier} to the fridge?: ")
- if answer.upper() == 'Y':
- continue
- elif answer.upper() == 'N':
- break
- while condition:
- more_food_choice = input("[Y/N] Would you like to add add a different type of food product?: ")
- if more_food_choice.upper() == 'Y':
- break
- elif more_food_choice.upper() == 'N':
- condition = False
- break
- else:
- print(f"Sorry, that's not one of the options. Please try again")
- return list_fruit, list_veg, list_dairy, list_sauce, list_sweet
- add_something_fridge(fruits, meats, vegetables, dairy, sauces, sweets)
- show_fridge()
Advertisement
Add Comment
Please, Sign In to add comment