Movatterモバイル変換


[0]ホーム

URL:


Previous PageUp One LevelNext PagePython Reference ManualContentsIndex
Previous:5.13 Evaluation orderUp:5. ExpressionsNext:6. Simple statements

 
5.14 Summary

The following table summarizes the operatorprecedences in Python, from lowestprecedence (least binding) to highest precedence (most binding).Operators in the same box have the same precedence. Unless the syntaxis explicitly given, operators are binary. Operators in the same boxgroup left to right (except for comparisons, which chain from left toright -- see above, and exponentiation, which groups from right toleft).

Operator Description 
lambdaLambda expression
orBoolean OR
andBoolean AND
notxBoolean NOT
in,notinMembership tests
is,is notIdentity tests
<,<=,>,>=,<>,!=,==Comparisons
|Bitwise OR
^Bitwise XOR
&Bitwise AND
<<,>>Shifts
+,-Addition and subtraction
*,/,%Multiplication, division, remainder
+x,-xPositive, negative
~xBitwise not
**Exponentiation
x.attributeAttribute reference
x[index]Subscription
x[index:index]Slicing
f(arguments...)Function call
(expressions...)Binding or tuple display
[expressions...]List display
{key:datum...}Dictionary display
`expressions...`String conversion


Previous PageUp One LevelNext PagePython Reference ManualContentsIndex
Previous:5.13 Evaluation orderUp:5. ExpressionsNext:6. Simple statements
Release 2.2.3, documentation updated on 30 May 2003.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2026 Movatter.jp