Python symbol priority

Source: Internet
Author: User
Operator Description
Lambda Lambda expressions
Or Boolean "or"
And Boolean "and"
Not x Boolean "Non"
In, not in Member Testing
Is, is not Identity Test
<, <=,>, >= ,! =, = Comparison
| By bit or
^ Bitwise OR
& Bitwise AND
<,> Shift
+ ,- Addition and subtraction
*,/, % Multiplication, division, and remainder
+ X,-x Plus or minus sign
~ X Flip by bit
** Index
X. attribute Attribute reference
X [index] Subscript
X [index: index] Addressing segment
F (arguments ...) Function call
(Experession ,...) Bind or display tuples
[Expression,...] List display
{Key: datum ,...} Dictionary display
'Expression ,...' String Conversion

 

The priority is the highest priority on the smallest side, from bottom to top. If you do not believe it, you can run the following code to confirm the priority.

 

True = True
False = False
If not false or true:
Print "yes"
Else:
Print "no"


##
# Ture or false => true
# False or false => false
# Ture or ture => true

# If it is not before or, true or yes will be returned
# If it is first or not, then it will certainly return false, that is, no,
# But the result outputs yes, which proves to be not first or

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.