Relative Content

Tag Archive for pythondictionarykeykey-value-store

Substract values dictionary from another dictionary’s values

I need to subtract the ingredients from a coffee (user choice = espresso, latte, cappuccino), which are given in a dictionary, from the base resources that the coffee machine holds (water, coffee, milk). Those resources are given in another dictionary. How can I subtract them from each other, after the user has chosen which coffee to go for?