Python Learning Note: Comparison of naming rules for Python and C-language identifiers

Source: Internet
Author: User

python identifier naming rules :
The first character of an identifier must be a letter in the alphabet (uppercase or lowercase) or an underscore (' _ ').
Other parts of the identifier name can consist of a letter (uppercase or lowercase), an underscore (' _ '), or a number (0-9).
The identifier name is case-sensitive. For example, MyName and myname are not an identifier. Note that the former lowercase n and
The latter in uppercase N.
Examples of valid identifier names are I, __my_name, name_23, and A1B2_C3.
Examples of invalid identifier names are 2things, this was spaced out, and my-name.

C language identifier naming rules:

Identifiers can only be made up of uppercase and lowercase letters, underscores (_), and Arabic numerals. The first character of an identifier must be an uppercase or lowercase letter or an underscore, not a number

Case sensitive

Summary: The same as the naming rules/sweat ....

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.