Dictionary: values and itervalues

#The values method returns a list of the values in the dictionary (and itervalues
#returns an iterator of the values). Unlike keys, the list returned by values may
#contain duplicates:
d = {}
d[1] = 1
d[2] = 2
d[3] = 3
d[4] = 1
print d.values()
Related examples in the same category