for each loop with dictionary : Dictionary Loop « Dictionary « Python






for each loop with dictionary

 

D = {'a':1, 'b':2, 'c':3}

for key in D:
     print key, D[key]

   
  








Related examples in the same category

1.Looping through dictionariesLooping through dictionaries
2.Dictionary for loopDictionary for loop