Skip to content

Instantly share code, notes, and snippets.

@alikarimi120
Created March 1, 2022 04:04
Show Gist options
  • Save alikarimi120/578d4244cbc0c786cc36e19b92cdc145 to your computer and use it in GitHub Desktop.
Save alikarimi120/578d4244cbc0c786cc36e19b92cdc145 to your computer and use it in GitHub Desktop.
d = {'cat': 'cute', 'dog': 'furry', "age":5, 'arr':[4,8], 6.3:8} # Create a new dictionary with some data
print(d)
print(d['cat']) # Get an entry from a dictionary; prints "cute"
print('cat' in d) # Check if a dictionary has a given key; prints "True"
print(d[6.3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment