PYTHON 容器TIPS
来源:互联网 发布:中国社会科学院 知乎 编辑:程序博客网 时间:2024/05/16 05:06
TIPS:
LIST: append()与extend()区别: a=[0,1,2,3] b=[4,5,6,7] a.append(b)=[0,1,2,3,[4,5,6,7]]a.extend=[0,1,2,3,4,5,6,7]
DICT: 遍历字典为元组形式: a{'c':1,'b':2} for o in a.iteritems(): print o
遍历KEY值:b=[x for x in a.iterkeys()] print b
MAP与REDUCE区别:MAP是对每一个元素进行操作 REDUCE是对整个集合进行归并
FILTER: 过滤集合中元素的值,返回过滤后的集合
0 0
- PYTHON 容器TIPS
- python tips
- Python tips
- python tips
- Python Tips
- python tips
- python tips
- Python tips
- Python Tips
- Python Tips
- Python-Tips
- Python Tips
- Python Tips & Tricks
- Python小tips
- Python Tips (1)
- Python Performance Tips
- python tips(1)
- python tips(2)
- 不管风云如何变幻 企业有“云算盘”就够了
- struts2中 Action获取表单参数的几种方式
- C++unoin的用法
- dll读取
- Apple Watch开发快速入门教程
- PYTHON 容器TIPS
- Alloc 和 AllocWithZone 区别和联系
- Android UI 模仿界面框架系列第一章:QQ UI框架
- ArcGIS 教程:Workflow Manager 快速浏览
- 第二周 课后实践:项目二——长方柱类
- Android官方开发指南-Loaders
- LeetCode 56.Merge Intervals
- 香港首届amfAR慈善晚会 刘嘉玲贝嫂美艳亮相
- Vim的各种小知识点