how to print only keys in dictionary python code example
Example 1: print key of dictionary python
for key, value in mydic.items() :
print (key, value)
Example 2: how to use dictionaries in python
student_data = {
"name":"inderpaal",
"age":21,
"course":['Bsc', 'Computer Science']
}
print(student_data['name'])
print(student_data['age'])
print(student_data['course'])[0]
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())
print(dictionary.keys())
print(dictionary.values())