How to combine amounts of "ingredients"? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to combine amounts of "ingredients"?

I'm trying to put together a script that has as main objective to return the quantity of coffee cups that can be produced, according to the quantity of ingredients needed for that. To produce 1 cup of coffee you need: Water = 300ml Milk = 200ml Sugar = 35g Beans of coffee = 15g This script has 4 inputs. The amount of water, milk, sugar, coffee beans and the amount of coffee cups the customer wants to make. What is the best way to handle it, in python? Using dicts, lists or tuples? I am really lost! I will be very grateful for a help.

18th Apr 2020, 3:00 AM
Evandro Mourão
Evandro Mourão - avatar
1 Answer
+ 3
none of what you said, variables are enough to do all calculations
18th Apr 2020, 3:32 AM
Aymane Boukrouh
Aymane Boukrouh - avatar