In general, when a function is stored as a variable, is that function automatically called? In the first few steps of the “Coffee Chatbot” project, we are asked to define function get_size() and include it in the definition of function coffee_bot():
coffee_bot()definition, call the
get_size()function and store the returned value in a variable called
size. Print out
sizeto see the value!
Here, simply storing “get_size()” as variable “size” within the function “coffee_bot” results in “get_size()” being called whenever “coffee_bot()” is called. Is this always the case with functions stored as variables? Does it matter if the variable in question is declared in or out of another function?