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]
相關文章
相關標籤/搜索