-
-
Save IndhumathyChelliah/407000f2eb970814ada79cd8f31e954f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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