Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created July 10, 2020 23:08
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/36caba3589160c94c0375037b694bea9 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/36caba3589160c94c0375037b694bea9 to your computer and use it in GitHub Desktop.
d={'name':'karthi',
'age':7,
'city':'chennai',
}
#accessing using index
print (d['name']) #Output: karthi
# If key doesn't exists in the dictionary means and if we use index, then it will raise KeyError
print (d['rollno']) # Output: KeyError: 'rollno'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment