Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active July 10, 2020 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/407000f2eb970814ada79cd8f31e954f to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/407000f2eb970814ada79cd8f31e954f to your computer and use it in GitHub Desktop.
#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