jimMoonrock

cook_book

Mar 6th, 2021 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. def cook_b(person):
  2.  
  3.     if isinstance(person, int):
  4.         cook_books = [
  5.             {"fruit salad in a bad": [{"apple jampling": 60}, {"pitchens of pineapple": 80}, {"slices of melon": 77},
  6.                               {"Vine": 81}, {"Bilberry": 78}, {"Mint leaves": 20}]
  7.             },
  8.  
  9.             {"crispy habrun potatoes": [{"grated potatoes ": 75}, {"vegetable iol": 60}, {"butter oil": 30}]
  10.             },
  11.  
  12.             {"skin pasta with sun-dried tomatoes, goat cheese and green salad": [{"orekiette pasta": 28},
  13.                                 {"Mediterranean salad mixes": 55}, {"dried tomatoes": 57}, {"goat cheese": 28},
  14.                                 {"grated parmesan": 59}]
  15.             }
  16.         ]
  17.  
  18.         for first_page in cook_books:
  19.             for dishes in first_page:
  20.                 print(f"For cooking {dishes} for {person} person's, you need:")
  21.                 for ingredients in first_page[dishes]:
  22.                     for food in ingredients:
  23.                         print(f"- Ingredient {food} for {person} person's need in "
  24.                               f"such quantities: {ingredients[food] * person}")
  25.             print()
  26.  
  27.     else:
  28.         print(TypeError(f"You entered a string value - {person} and you need an integer value. "))
  29.  
  30. print(cook_b(12))
Add Comment
Please, Sign In to add comment