how to print the keys of a dictionary in python code example
Example 1: print key of dictionary python
for key, value in mydic.items() :
print (key, value)
Example 2: get all keys and values from dictionary python
#python 3
for k,v in dict.items():
print(k, v)
Example 3: print key of dictionary python
for key, value in mydic.iteritems() :
print key, value
Example 4: python dict print keys
print(dictionary.items()) #prints keys and values
print(dictionary.keys()) #prints keys
print(dictionary.values()) #prints values