-
Notifications
You must be signed in to change notification settings - Fork 3
/
3.5.9 Recipe.py
36 lines (29 loc) · 979 Bytes
/
3.5.9 Recipe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ingredient_one = ""
ingredient_two = ""
ingredient_three = ""
ingredient_one_amount = 0
ingredient_two_amount = 0
ingredient_three_amount = 0
for i in range(3):
x = input("What is the name of ingredient number " + str(i + 1) + "? ")
y = float(input("What is the amount of ingredient " + str(i + 1) + " (oz)? "))
if i == 0:
ingredient_one = x
ingredient_one_amount = y
print("0")
elif i == 1:
ingredient_two = x
ingredient_two_amount = y
print("1")
else:
ingredient_three = x
ingredient_three_amount = y
print("2")
s = int(input("How many servings? "))
tot1 = ingredient_one_amount * s
tot2 = ingredient_two_amount * s
tot3 = ingredient_three_amount * s
print("You will need:")
print(str(tot1) + " times the amount of " + ingredient_one)
print(str(tot2) + " times the amount of " + ingredient_two)
print(str(tot3) + " times the amount of " + ingredient_three)