PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# In order to make burger a chef needs at least the following ingredients:
# • 1 piece of chicken meat
# • 3 lettuce leaves
# • 6 tomato slices
# Write down a formula to figure out how many burgers can be made. Get values
# of chicken meat, lettuce leaves and tomato slices from user. Hint: use
# Python’s built-in functions
requirements = {
"Chicken": 1,
"Lettuce": 3,
"Tomato": 6
}
stock = {}
print("Please enter current stocks of:")
for ingredient in requirements:
stock[ingredient] = int(input(f"{ingredient} : ")) // requirements[ingredient]
print(f"\nYou can make {min(stock.values())} burgers with your current stock.")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run