I wonder, is the python function the coffee machine, or is the python language the coffee machine, or is my operating system the coffee machine? Or is my computer the coffee machine?
In the analogy, the coffee machine represents the function. You provide it with stuff (coffee, water, electricity) and these are the arguments you use when you call the function, and it gives you hot, liquid coffee—the function's return value.
Of course, analogies are just that, of course, and they always fail if you push to far, but this is a good way of visualising what a function does
I wonder, is the python function the coffee machine, or is the python language the coffee machine, or is my operating system the coffee machine? Or is my computer the coffee machine?
In the analogy, the coffee machine represents the function. You provide it with stuff (coffee, water, electricity) and these are the arguments you use when you call the function, and it gives you hot, liquid coffee—the function's return value.
Of course, analogies are just that, of course, and they always fail if you push to far, but this is a good way of visualising what a function does