内容简介:Python 字典(Dictionary) values() 函数以列表返回字典中的所有值。
描述
Python 字典(Dictionary) values() 函数以列表返回字典中的所有值。
语法
values()方法语法:
dict.values()
参数
- NA。
返回值
返回字典中的所有值。
实例
以下实例展示了 values()函数的使用方法:
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7}
print "Value : %s" % dict.values()以上实例输出结果为:
Value : [7, 'Zara']
以上所述就是小编给大家介绍的《Python 字典(Dictionary) values()方法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
The Nature of Code
Daniel Shiffman / The Nature of Code / 2012-12-13 / GBP 19.95
How can we capture the unpredictable evolutionary and emergent properties of nature in software? How can understanding the mathematical principles behind our physical world help us to create digital w......一起来看看 《The Nature of Code》 这本书的介绍吧!
JS 压缩/解压工具
在线压缩/解压 JS 代码
RGB HSV 转换
RGB HSV 互转工具