Dictionary: values and itervalues : Dictionary values « Dictionary « Python






Dictionary: values and itervalues

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

1.Dictionary: The keys, values, and items FunctionsDictionary: The keys, values, and items Functions