Python-Variables for python

Source: Internet
Author: User
  1. Python's variables are dynamic and do not need to be stated in advance, the variables are created automatically when the assignment is made, and the Python variable stores the reference to the object (the non-variable itself).

  2. The naming conventions for python variables are similar to the C language and generally follow some of the following rules in everyday use:

    A. Generally do not start with a single underscore "_" because a variable that starts with a single underscore cannot be imported by the From module import *;

    B. There is a system-defined variable name before and after the double slide line, which has special meaning to the interpreter, so it is not usually started and ended with double underscore;

    C. Variables that begin with a double underscore are generally used as local variables of the class;

    D. Self has a special meaning to the class, and Python also has a large number of built-in variable name eg.print, etc., generally need to avoid use;

    E. Python's variable name usually begins with an uppercase letter, and its module name starts with a lowercase letter.

Python-Variables for 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.