python 字典get方法
2016-04-19 16:04
549 查看
t1 = [
['aa'],
['ff'],
['er']
]
t2 = [
['aa', 11,],
['er', 99,]
]
d2 = dict(t2)
res = [[k[0], d2.get(k[0], 0)] for k in t1]
[/code]
[/code][/code]
来自为知笔记(Wiz)
相关文章推荐
- Python学习(2)基本语法
- python学习笔记(pict+requests+xml)
- 【python小练】0017-将xls文件内容写入xml文件中
- Python学习笔记(九)
- python学习
- python 鸭子类型
- Python字符串的方法及注释
- python 安装lxml失败
- Python webdriver 常见异常及描述
- python itertools模块
- Python webdriver 读取本地csv文件中数据 提示:IOError: [Errno 2] No such file or directory
- Ubuntu14.04通过pyenv配置多python
- python 基本语法
- python 文件游标以及 re 中的 match,sub(具体示例)
- python中threading模块详解
- Python快速搭建自动回复微信公众号
- python中pymssql模块操作SQL Server
- x64 python3.4 + opencv3.1.0 + opencv_contrib_master
- Python相对导入导致SystemError的解决方案(译)
- Python相对导入导致SystemError的解决方案(译)