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