序列解包

序列解包

a = {10: 500, 20: 200, 30: 300, 40: 400, '委员会设立情况': '公司治理'}
z,b,c,d,e = a #返回键
print(z)
print(e)
f,j,h,i,g = a.values() #返回值
print(f)
print(g)
k,l,m,n,o = a.items() #返回键值对
print(k)
print(o)

10

委员会设立情况

500

公司治理

(10, 500)

('委员会设立情况', '公司治理')

(s,d,f) = ('nishi',10,40) #nishi
print(s)
[s,d,f] = ['nishi', 10, 40] #40
print(f)

posted @ 2023-05-15 19:28  白小火  阅读(42)  评论(0)    收藏  举报