Definition and calling of Python functions

Definition and calling of Python functions

Insert picture description here

Call :

Only with () means calling. This is how it runs in memory. First, find the matching address based on the function name, and then go to the address to find the contents and execute the contents.

Participation parameters:

When defining a function in Python, the parameters in parentheses are formal parameters, and the characteristic is that the formal parameters are variable names.
The actual parameter means that when the function is called, the parameter in the bracket becomes the actual parameter, and the characteristic is that the actual parameter is the variable value.

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_44994799/article/details/109730825