For loop through the dictionary keys : Dictionary Key « Dictionary « Python






For loop through the dictionary keys

For loop through the dictionary keys
 
table = {'Python':  'Guido van Rossum',
          'Perl':    'Larry Wall',
          'Tcl':     'John Ousterhout' }

for lang in table.keys(): 
     print lang, '\t', table[lang]



           
         
  








Related examples in the same category

1.Use variable as a keyUse variable as a key
2.Dictionary: create a new list of keysDictionary: create a new list of keys
3.Dictionary: The keys, values, and items FunctionsDictionary: The keys, values, and items Functions
4.Sorting Keys: for Loops
5.Dictionary Keys Are Case-SensitiveDictionary Keys Are Case-Sensitive