python3运算符号优先级

lambda: Lambda Expression

if - else: Conditional expression

or: Boolean OR

and: Boolean AND

not x: Boolean NOT

in, not in, is, is not, <, <=, >, >=, !=, ==: Comparisons, including membership tests and identity tests

| : Bitwise OR

^ : Bitwise XOR

& : Bitwise AND

<<, >>: Shifts

+, -: Addition and subtraction


*, /, //, %: Multiplication, Division, Floor Division and Remainder

+x, -x, ~x: Positive, Negative, bitwise NOT

**: Exponentiation

扫描二维码关注公众号,回复: 2245088 查看本文章
整理自:《A Byte of Python》

猜你喜欢

转载自blog.csdn.net/sknight_31/article/details/81056510