1.序列解包
eg:
>>> x, y, z = 1, 2, 3
>>> print(x, y, z)
1 2 3
2.链式赋值
链式赋值(chained assignment)是将同一个赋值给多个变量的捷径。
eg:
x = y = somefunction()
3.增量赋值
1.序列解包
eg:
>>> x, y, z = 1, 2, 3
>>> print(x, y, z)
1 2 3
2.链式赋值
链式赋值(chained assignment)是将同一个赋值给多个变量的捷径。
eg:
x = y = somefunction()
3.增量赋值