
上QQ阅读APP看书,第一时间看更新
2.4.4 赋值运算符
Python除了普通的赋值运算符外,还提供了复合赋值运算符,见表2-7。赋值运算的规则是从右向左运算。
表2-7 赋值运算符

(续)

【例2-12】 演示Python所有赋值运算符的操作。

上面程序的运行结果如图2-18所示。

图2-18 例2-12运行结果
Python除了普通的赋值运算符外,还提供了复合赋值运算符,见表2-7。赋值运算的规则是从右向左运算。
表2-7 赋值运算符
(续)
【例2-12】 演示Python所有赋值运算符的操作。
上面程序的运行结果如图2-18所示。
图2-18 例2-12运行结果