Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active Jul 10, 2020
Embed
What would you like to do?
#creating dictionary:
d={'name':'karthi',
'age':7,
'city':'chennai',
}
#print only keys
print (d.keys()) #Output: dict_keys(['name', 'age', 'city'])
#print (key,value) pair.
print (d.items()) #Output: dict_items([('name', 'karthi'), ('age', 7), ('city', 'chennai')])
#print only values
print (d.values()) #Output: dict_values(['karthi', 7, 'chennai'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment