Python getting a List of Keys in a Dictionary

Posted by Samath
  374
January 13, 2017

 

This python program get and print all the keys in a dictionary.

d = {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}

print 'List: ', d.keys()