Python dictionary values() method
Return the values.
Syntax
dict.values()
Parameters
None.
Return value
a view of the values
Example
Code
prices = {"tea": 3.0, "coffee": 4.5, "cake": 5.0} print(list(prices.values())) print(sum(prices.values()), max(prices.values()))
Output
[3.0, 4.5, 5.0] 12.5 5.0
Related
Learn it step by step in the free lesson Dictionaries & Sets, with exercises that check your answers.