返回顶部

收藏

List as a value in a dictionary

更多
mel = {'name': 'Mark',
        'jobs': ['trainer', 'writer'],
        'web':  'www.rmi.net/~lutz',
        'home': {'state': 'CO', 'zip':80501}}

print mel['name']

print mel['jobs']

print mel['jobs'][1]

print mel['home']['zip']

标签:Python,Dictionary

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2015-11-30 12:00:58Change dictionary entry by 司马
  2. 2016-08-18 16:06:03Dictionary get value by 张宋付
  3. 2013-06-05 13:21:25python 使用MySQLdb连接mysql by 玉开Sir
  4. 2016-01-18 18:59:48Reference dictionary in print function by 大猪
  5. 2016-08-18 16:22:21Dictionary: items and iteritems by Solon.Ring
  6. 2016-08-19 10:11:08Copy a dictionary by 司马
  7. 2016-09-15 14:35:42Dictionary: values and itervalues by 山药
  8. 2016-01-10 09:34:59If it has a certain key by 张宋付
  9. 2016-02-05 11:12:31Dictionary popitem by xwz
  10. 2016-08-18 16:39:08Dictionary: The keys, values, and items Functions by xwz
  11. 2016-08-31 12:28:03Dictionary has_key method by 山药

发表评论