Fourth: Python function cont.

Source: Internet
Author: User
1. Namespaces and Scopes
Namespace: Where the name is stored, the exact name space is where the name and the value of the variable are bound.
Namespaces have a total of three namespaces, both:
1. Built-in namespaces: generated when the Python interpreter starts, storing some python built-in names
2. Global namespace: Generated when executing a file, holding the name of the file-level definition
3, Local namespace: In the process of executing a file, if a function is called, it will produce a local namespace for the function, to hold the name defined within the function, which takes effect when the function is called and expires after the function call ends

Load order: Built-in = = = "Global = = =" Local


First: The name of the search order is: local = = "Global = =" Built-in


Fourth: Python function cont.

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.