1 Star 0 Fork 0

前端代码工具库 / python_demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dict.py 180 Bytes
一键复制 编辑 原始数据 按行查看 历史
diogoxiang 提交于 2015-11-25 20:16 . 更新一些实例
# coding=utf-8
d = {'Michael': 95, 'Bob': 75, 'Tracy': 85}
print(d['Bob'])
# 如果不在返回 None
print(d.get('Thomas'))
print(d.get('boo',-1)) #可自定义返回值
Python
1
https://gitee.com/tomxiang/python_demo.git
git@gitee.com:tomxiang/python_demo.git
tomxiang
python_demo
python_demo
master

搜索帮助