lst = list("abc") t1, t2, t3 = lst # 列表拆包 print(t1) # a print(t2) # b print(t3) # c t1 = ("A", "B", "C") a, b, c = t1 # 元组拆包 print(a) # A print(b) # B print(c) # C d1 = {x: x ** 2 for x in (1, 2, 3)} x, y, z = d1 # 字典拆包,取出来的事字典的key print(x) # 1 print(y) # 2 print(z) # 3
标签:解包,t1,拆包,列表,print,元组,字典 From: https://www.cnblogs.com/sangern/p/17414751.html