● Python運算符包括:
● 算術運算符
+、-、*、/、//、%、**
● 賦值運算符
=、+=、-=、*=、/=、//=、%=、**=
● 關係運算符
<、>、<=、>=、==、!= (返回布爾值:True或False)
● 邏輯運算符
and 邏輯與 True and True --> True, True and False --> False
or 邏輯或 True or True --> True, True or False --> True, False or False --> False
not 邏輯非 not True -->False, not False -->True
● Python 表達式
表達式是將不同數據(包括變量、函數)用運算符號按一定規則連接起來的一種式子。
● Python運算符的優先級
如圖: