Python Basics (i)

Source: Internet
Author: User

1. Comment on several annotation methods in Python:

(1) #号注释 single-line comment
# This is a comment
def func ():
Pass
(2) Multi-line Comment

""" """ ‘‘‘ ‘‘‘
Multi-line comments are also divided into single quotes, multiline comments, and double quotation marks.

2. Variables

Variables: variables are used to better manage memory and to make full use of memory space

Variable type: numeric type (Numbers), Boolean type (bool), string, list, tuple (tuple), dictionary (dict)

Number types: int, float, long (longer, less common), complex (plural)

Boolean type: True, False

The definition of a variable is already defined in the underlying language, and it is not necessary to define the declaration again, which can be used directly for assignment. You can use the type to view

3. Identifiers

The identifier is the programmer's name for some code in the program, which is often used more than once, so in Python there are some naming conventions for these names.

Big Hump naming method: Every word of the first letter are capitalized operations, because many names are composed of multiple words, such as username, MyName ...

Small hump nomenclature: The first letter of the first word is lowercase, the first letter of the following word is capitalized username, Usernameworld ...

Underline connection naming method: such as Send_name, User_center_info ...

4. Keywords

Keyword: An identifier that has been assigned a special meaning in Python, and has been given a meaning identifier.

Example: print, input, pass, def ...

Python Basics (i)

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.