先来看看解封装

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-12-22
  • 2022-02-14
  • 2021-07-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2021-11-18
相关资源
相似解决方案