Python Getting Started tutorial learn notes # # Basic section

Source: Internet
Author: User
Tags arithmetic

3.1 Data types

    • Number (numeric) int, float, bool, complex (plural) int, expressed as a long integer and no long in Python2. There is no Boolean type in Python2, it is represented by the number 0 flase
    • String (string) the strings in Python are enclosed in single quotation marks (') or double quotation marks ("), and use backslashes (\) to escape special characters.

3.2 Data Structures

list, denoted by [], lists can be used in many ways, such as indexing and interception. list=[a,b,1,2,3,4]

Tuples, tuples cannot be changed, and () indicate that elements are separated by commas. tup = (1, 2, 3, 4, 5, 6). Functions are returned in tuples

A dictionary, which is a type of mapping, represented by {}, is an unordered collection of objects. Dict={key:value,key2,value2}

Collection, which is a sequence of unordered repeats, denoted by {}, or set () function. Parame={value1,value2}

3.3 Data operations

Arithmetic operations, subtraction

Compare operations, compare sizes

Assignment operations, assigning values or references to variables

bitwise operations, by and or non-arithmetic, move the number of bits

Logical operations, logical Boolean values

Member scatter, in or not in, query member

Identity operation, is or not is, querying identities, comparing storage units of two objects

Python Getting Started tutorial learn notes # # Basic section

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.