1. 序列解包 sequence unpacking
ex1
x,y,z = 1,2,3x,y=y,xprint x,y,z2 1 3
ex2
d={'name':'stewart','age':'25' }print d key,value = d.popitem() #popitem()随机取出一项键值对print key,value{'age': '25', 'name': 'stewart'}age 25
2.链式赋值 chained assignment
x,y=1,2u=y=x #等同于y=x,u=yprint x,y,u1 1 1
3.增量赋值 augmented assignment
x,y=1,'foo'x +=3x *=4y +='bar'y *=2print x,y 16 foobarfoobar