Python中collections模块总结

Collection模块 1. tuple”拆包"特性 代码示例:web t=("a",14,"f",55) a,b,c,d = t #将t中的值依次赋给a,b,c,d print(a,b,c,d) a,b,*other = t # *other 表明除a,b之外的其它值的集合(注意:这是*的做用) print(other) print(a,b) 输出:安全 a 14 f 55 ['f', 55]
相关文章
相关标签/搜索