Return and execution of a return in Python

Source: Internet
Author: User

Author:headsen Chen

Date:2018-03-21 15:12:09

Notice:created by Headsen Chen himself and not allowed to copy, or your count law questions.

1, the difference between the print function name and the execution process of the print functions:

============= "

Summary: Print the function's name print (a), and the result is that the memory address of the functional is printed out.

Print function execution: print (A ()), printing the function of the execution of the print part of the program, and finally the return of the contents of the print, there is no function to define return print none.

2, the function content body executes:

============= "

3, execute in return of the function:

============= "

Summary: When a function executes, the program also executes normally when the return content of the function is an executable program. However, the concept of the return value at this point is to print the printed part of the program and print the return value of the function, and return none if the return value is not defined

4, print the function name (essentially, the memory address that corresponds to the print variable name: That is, the memory address of the content body corresponding to the function)

============= "

return a (): Even though this return is a (), the memory address of two functions is still printed because the B () function is not called

============= "

5, the contents of return in the function is a function execution problem in the case of constants and variables (executable functions)

Return is a constant: because the B () function is empty. And a of return is a variable, which is a memory address

============= "

Return is a variable (executable function), then when the B function is run, the body of the B function and the program in return will run, the effect is as follows:

============= "

Return and execution of a return in Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.