pihta24

Бариста

Feb 2nd, 2021
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. ingredient = {'Эспрессо': [1, 0, 0], 'Капучино': [1, 3, 0],
  2.               'Маккиато': [2, 1, 0], 'Кофе по-венски': [1, 0, 2],
  3.               'Латте Маккиато': [1, 2, 1], 'Кон Панна': [1, 0, 1]}
  4.  
  5.  
  6. def choose_coffee(*preferences):
  7.     for i in preferences:
  8.         if ingredient[i][0] <= ingredients[0] and ingredient[i][1] <= ingredients[1] \
  9.                 and ingredient[i][2] <= ingredients[2]:
  10.             ingredients[0] -= ingredient[i][0]
  11.             ingredients[1] -= ingredient[i][1]
  12.             ingredients[2] -= ingredient[i][2]
  13.             return i
  14.     return 'К сожалению, не можем предложить Вам напиток'
Advertisement
Add Comment
Please, Sign In to add comment