Return in Python

Return in Python

Often when developing, we rarely look at the console, and print is only limited to display on the console. And outside of this function, we can't get this result with print. See below:
Insert picture description here

And return , the result of the operation in the function is "thrown out" through the return keyword, and the result of the operation is returned. When calling a function, there must be a container followed . Outside the function, the result can also be printed.
Insert picture description here
Insert picture description here

Guess you like

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