zip

先上官网的定义:

 zip的使用:

将多个 list 组合成 tuple 的 list:


 

 将多个 list 组成 dict:

将多个 tuple 组成的 list 拆分成多个 tuple:

 将多个 list 组成的 list 拆分成多个 tuple:

将多个 tuple 组成的 tuple 拆分成多个 tuple:

将列表中相邻的几项合并:

 

参考博客;

https://blog.csdn.net/pipixiu/article/details/81255533#%E8%87%B4%E8%B0%A2

 

发布了53 篇原创文章 · 获赞 29 · 访问量 2万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章