Calling a fuction its exactly what it sounds like. You are telling the fuction to act on the values you have stablished. to call a fuction first you must have a variable that will get the return value of your fuction.
example:
lets say you crated a fuction called: make_sum.
the fuction would look like this:
return ans
so in your code you would create a varible, lets say:
the_sum =
then you write the fuction, adding the values that you want it to take.
the_sum = make_sum(2,5)
so:
make_sum(x,y):
return ans
will become:
return ans
and the variable the_sum will receve the return value of:
return ans
wich in this case is 7.
The Fun with numbers code in here shows an example of a program that calls differnt fuctions.
note: is very usefull to create your fuctions in a separate place from the rest of the code.
#Mastery11 how to call a fuction. by Eduardo Merino is licensed under a Creative Commons Attribution 4.0 International License.