Advertisement
Brompy

Fridge

Oct 9th, 2019
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.38 KB | None | 0 0
  1. fruits = []
  2. meats = []
  3. dairy = []
  4. vegetables = []
  5. sauces = []
  6. sweets = []
  7.  
  8. #should add option to add nothing to each category
  9. #should restrict total # of items to limited amount
  10. #should add budget, each item costs certain amount
  11. #should print list of recipes you can make with added items.
  12.  
  13. print("\n\n\n:::Your fridge is empty.:::")
  14.  
  15.  
  16. def show_fridge():
  17.     """Shows contents of all types currently in the fridge."""
  18.     print("\n:::::Here's everything in the fridge:::::")
  19.     print("\n:::Fruits:::")
  20.     for fruit in fruits:
  21.         print(fruit.title())
  22.     print("\n:::Vegetables:::")
  23.     for vegetable in vegetables:
  24.         print(vegetable.title())
  25.     print("\n:::Meats:::")
  26.     for meat in meats:
  27.         print(meat.title())
  28.     print("\n:::Dairy:::")
  29.     for dair in dairy:
  30.         print(dair.title())
  31.     print("\n:::Sauces:::")
  32.     for sauce in sauces:
  33.         print(sauce.title())
  34.     print("\n:::Sweets:::")
  35.     for sweet in sweets:
  36.         print(sweet.title())
  37.  
  38. def add_fruit_fridge():
  39.     """Puts fruit in the fridge until user terminates loop."""
  40.     while True:
  41.         print("\n:::What fruits do you want to add?::: ")
  42.         fruits.append(input("\n"))
  43.         answer = input("Anything else? Please enter Y or N: ")
  44.         if answer == 'Y':
  45.             print("\n")
  46.         elif answer == 'N':
  47.             break
  48.         else:
  49.             break
  50.  
  51. def add_veg_fridge():
  52.     """Puts vegetables in the fridge until user terminates the loop."""
  53.     while True:
  54.         print("\n:::What vegetables would you like to add?:::" )
  55.         vegetables.append(input("\n"))
  56.         answer = input("Any other vegetables you want to add? Y or N: ")
  57.         if answer == 'Y':
  58.             vegetables.append(input("\n:::What vegetables do you want to add?::: "))
  59.         elif answer == 'N':
  60.             break
  61.         else:
  62.             break
  63.  
  64. def add_meats_fridge():
  65.     """Puts meats in the fridge until user terminates the loop."""
  66.     while True:
  67.         print("\n:::What meats do you want to add?:::")
  68.         meats.append(input("\n"))
  69.         answer = input("Any other meats you want to add? Y or N: ")
  70.         if answer == 'Y':
  71.             meats.append(input("\n:::What other meats do you want to add?::: "))
  72.         elif answer == 'N':
  73.             break
  74.         else:
  75.             break
  76.  
  77. def add_dairy_fridge():
  78.     """Puts dairy items in the fridge until user terminates the loop."""
  79.     while True:
  80.         print("\n:::What dairy items would you like to add?:::")
  81.         dairy.append(input("\n"))
  82.         answer = input("Do you want to add more dairy items? Y or N: ")
  83.         if answer == 'Y':
  84.             dairy.append(input("\n:::What dairy items would you like to add?:::"))
  85.         elif answer == 'N':
  86.             break
  87.         else:
  88.             break
  89.  
  90. def add_sauces_fridge():
  91.     """Puts sauces in the fridge until user terminates the loop."""
  92.     while True:
  93.         print("\n:::What sauces do you want to add?:::")
  94.         sauces.append(input("\n"))
  95.         answer = input("Do you want to add more sauces to the fridge? Y or N: ")
  96.         if answer == 'Y':
  97.             sauces.append(input("\n::What kinds of sauces do you want to add?:::"))
  98.         elif answer == 'N':
  99.             break
  100.         else:
  101.             break
  102.  
  103. def add_sweets_fridge():
  104.     """Puts sweets in the fridge until user terminates the loop."""
  105.     while True:
  106.         print(":::What sweets do you want to add?:::")
  107.         sweets.append(input("\n"))
  108.         answer = input("Do you want to add more sweets to the fridge? Y or N: ")
  109.         if answer == 'Y':
  110.             sweets.append(input("\n:::What sweets do you want to add?:::"))
  111.         elif answer == 'N':
  112.             break
  113.         else:
  114.             break
  115.                
  116. add_fruit_fridge()
  117. add_veg_fridge()
  118. add_meats_fridge()
  119. add_dairy_fridge()
  120. add_sauces_fridge()
  121. add_sweets_fridge()
  122.  
  123. show_fridge()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement