Skip to content

Instantly share code, notes, and snippets.

Last active Jul 10, 2020
What would you like to do?
#creating dictionary:
#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