首页
技术博客
登录
6mi
u
盘
搜
搜 索
技术博客
Python的序列解包
Python的序列解包
tech
2026-06-09
4
Python的序列解包是一种语法糖,很实用,在函数返回多个值的时候使用尤为方便
def test_two_res(): n = 2 m = 3 return n,m n,m = test_two_res() print(n,m) #2 3 n,m,*c = "zhangsan" print(n,m,c) #z h ['a', 'n', 'g', 's', 'a', 'n']
转载请注明原文地址:https://tech.qufami.com/read-28122.html
最新回复
(
0
)