-
-
Save IndhumathyChelliah/be083526ce6f011a53bad73731cec8cf 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
d={'name':'karthi', | |
'age':7, | |
'city':'chennai', | |
} | |
print (d)#Output:{'name': 'karthi', 'age': 7, 'city': 'chennai'} | |
#Assigning values. If key already exists in the dictionary means,it will update value. | |
d['age']=8 | |
print (d)#Output:{'name': 'karthi', 'age': 8, 'city': 'chennai'} | |
#Assigning values.If key doesn't exists in the dictionary means,it will add that key. | |
d['rollno']=12 | |
print (d)#Output:{'name': 'karthi', 'age': 8, 'city': 'chennai', 'rollno': 12} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment