Python Dictionary values() Method
Description
The Python Dictionary values() function returns all values in the dictionary as a list.
Syntax
The syntax of the values() method is:
dict.values()
Parameters
- NA。
Return Value
Returns all values in the dictionary.
Example
The following example demonstrates the usage of the values() function:
Example
#!/usr/bin/python
tinydict = {'Name': 'Example', 'Age': 7}
print "Value : %s" % tinydict.values()
tinydict = {'Name': 'Example', 'Age': 7}
print "Value : %s" % tinydict.values()
The output of the above example is:
Value : [7, 'Example']Other Extensions
Python Dictionary