Chapters
Python114 chapters

ReferenceDictionary methods

dict.values()

A live view of the values, in insertion order.

Signature

mapping.values()

Returns

A view object.

Example

Python
scores = {"a": 3, "b": 1}
print(list(scores.values()))
print(sum(scores.values()))
print(max(scores.values()))

Output

[3, 1]
4
3

See also