Python‎ > ‎dict‎ > ‎

dict.values()

http://www.adilwaseem.com/

Definition
The returns with values of the dictionary corresponding to the keys.

Syntax
dict.values()

Parameters
None

Examples
The returns with:
 >>> x=dict({'VA':3.1, 'DC':2,'NY':5.1, 'CA':4.4})>>> x.values()
dict_values([3.1, 2, 5.1, 4.4])

Returns as:
 >>> a=dict({'Din': 4, 'John': 2, 'Adil': 3, 'Fen': 1})
>>> a.values()
dict_values([4, 2, 3, 1])
>>>

str.maketrans.__eq__(dict)
Returns are:
 >>> x="1234"
>>> y="5678"
>>> z=str.maketrans(x,y)
>>> z
{49: 53, 50: 54, 51: 55, 52: 56}
>>> 
>>> z.__eq__({49: 53, 50: 54, 51: 55, 52: 56})
True
>>> z.items()
dict_items([(49, 53), (50, 54), (51, 55), (52, 56)])
>>> z.values()
dict_values([53, 54, 55, 56])


Comments