Advertisement
Guest User

make_chocolate

a guest
Apr 7th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1.     def make_chocolate(self, recipe_name: str):
  2.         if recipe_name in self.recipes:
  3.             if recipe_name not in self.products:
  4.                 self.products[recipe_name] = 1
  5.             else:
  6.                 self.products[recipe_name] += 1
  7.             recipe_needed_ingredients = self.recipes[recipe_name]
  8.             for k, v in recipe_needed_ingredients.values():
  9.                 self.remove_ingredient(k, v)
  10.         else:
  11.             raise TypeError("No such recipe")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement