Python Seventh day (variable)

Source: Internet
Author: User

Variable naming rules


Grammar:

Underscore or letter start + any number of letters/numbers/underscores

Case sensitive:

Prohibit the use of reserved words:

False class finally is return

None continue for Lambda try

True def from Nonlocal while

And Del Global not with

As Elif if or yield

Assert Else Import Pass

Break except in Ra1se


Naming conventions


Variable names that begin with a single dash will not be imported by the From module import * statement

An underscore variable is a system-defined variable name before and after

Starting with two underscores is a local variable of the class

Interactive mode runtime only a single underlined variable name saves the last expression result


This article is from the "Don't Ang" blog, please be sure to keep this source http://wuang.blog.51cto.com/9559762/1606982

Python Seventh day (variable)

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.