Python dictionary values() Method
Advertisements
Description
The method values() returns a list of all the values available in a given dictionary.
Syntax
Following is the syntax for values() method
dict.values()
Parameters
NA
Return Value
This method returns a list of all the values available in a given dictionary.
Example
The following example shows the usage of values() method.
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7}
print "Value : %s" % dict.values()
Let us compile and run the above program, this will produce the following result:
Value : [7, 'Zara']