To loop over the keys of a dictionary, you can use a plain for statement : Introduction : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Introduction »

 

To loop over the keys of a dictionary, you can use a plain for statement


d = {'x'1'y'2'z'3

for key in d: 
    print key, 'corresponds to', d[key]



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Introduction