先來看看解封裝
mytuple=3,4,5
print(mytuple)#(3, 4, 5)
這將3,4,5封裝到元組mytuple中
現在我們將這些值解封裝到變量x,y,z中
mytuple=3,4,5 print(mytuple) #(3, 4, 5) x,y,z=mytuple print(x+y+z) #12
先來看看解封裝
mytuple=3,4,5
print(mytuple)#(3, 4, 5)
這將3,4,5封裝到元組mytuple中
現在我們將這些值解封裝到變量x,y,z中
mytuple=3,4,5 print(mytuple) #(3, 4, 5) x,y,z=mytuple print(x+y+z) #12
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。