Python/ Rangfolge der Operatoren
Erscheinungsbild
< Python
| Rang | Operator | Beschreibung | Assoziativität |
|---|---|---|---|
| 1 | () | Klammern | |
| 2 | x[index], x[index1:index2] | Indizierung, Teilsequenz (slice) | links |
| 3 | await x | "await"-Ausdruck | N/A |
| 4 | ** | Potenzierung | rechts |
| 5 | +x, -x, ~x | Positives, negatives Vorzeichen, bitweises NOT | rechts |
| 6 | *, /, //, %, @ | Multiplikation, Division, ganzzahlige Division, Modulo, Matrixmultiplikation | links |
| 7 | +, - | Addition und Subtraktion | links |
| 8 | <<, >> | bitweises Verschieben | links |
| 9 | & | bitweises AND | links |
| 10 | ^ | bitweises XOR | links |
| 11 | | | bitweises OR | links |
| 12 | in, not in, is, is not, <, <=, >, >=, !=, == | Tests auf Zugehörigkeit, Identität, Vergleiche | N/A |
| 13 | not x | logisches NOT | |
| 14 | and | logisches AND | links |
| 15 | or | logisches OR | links |
| 16 | if-else | bedingter Ausdruck | rechts |
| 17 | lambda | Lambda-Ausdruck | N/A |
| 18 | := | Zuweisungs-Ausdruck |