Die Python-Sprache unterstützt die folgenden Arten von Operatoren:
Arithmetische Operatoren
Vergleichsoperatoren (relationale Operatoren)
Zuweisungsoperatoren
Logische Operatoren
Bitoperatoren
Mitgliedsoperatoren
Identit?tsoperatoren
Operatorpriorit?t
Python-Operatoren Syntax
Die Python-Sprache unterstützt die folgenden Arten von Operatoren:
Arithmetische Operatoren
Vergleichsoperatoren (relationale Operatoren)
Zuweisungsoperatoren
Logische Operatoren
Bitoperatoren
Mitgliedsoperatoren
Identit?tsoperatoren
Operatorpriorit?t
Python-Operatoren Beispiel
#!/usr/bin/python# -*- coding: UTF-8 -*- a = 21 b = 10 c = 0 c = a + b print "1 - c 的值為:", c c = a - b print "2 - c 的值為:", c c = a * b print "3 - c 的值為:", c c = a / b print "4 - c 的值為:", c c = a % b print "5 - c 的值為:", c # 修改變量 a 、b 、c a = 2 b = 3 c = a**b print "6 - c 的值為:", c a = 10 b = 5 c = a//b print "7 - c 的值為:", c