Python jobs (operator continuation)

Source: Internet
Author: User

operator continuation

1 arithmetic operations

2 comparison operations

3 Assignment operations

4-bit operation:

Note:

5 Logical operations

and annotations:

1 in Python, and and of the Boolean logic calculus, as you expect, but they do not return a Boolean value: instead, return

One of the values that they actually compare.

2 The value of a left-to-go calculation expression in a Boolean context, if all values in the Boolean context are true,

Then and returns the last value.

3 If a value in a Boolean context is false, and returns the first false value

or annotations:

1 when using or, from left to right in a Boolean context, just like and, if a value is true,

or returns the value immediately

2 If all values are false, or returns the last False value

3 note or in a Boolean context, the expression calculus is always performed until a true value is found and then ignored

The remaining comparison values

And-or Results using:

1 combined with the previous two kinds of grammar, reasoning can be.

2 in order to enhance the readability of the program, preferably with parentheses, columns such as:

(1 and X ") or ' Y '

6 Member operations

7 Identity operations

8 Operation priority: top-down, priority high to low

Summary of standard data types

Differentiate by number of stored values

Scalar/Atomic Type Number, string
Container type list, tuple, dictionary

By Variable immutable distinction

Variable List, dictionary
Not variable Numbers, strings, tuples

Differentiate by Access order

Direct access Digital
Sequential access (sequence type) String, list, tuple
Key value access (mapping type)

Python jobs (operator continuation)

Related Article

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.