Skip to content

Instantly share code, notes, and snippets.

@ardenn
Created October 1, 2018 17:54
Show Gist options
  • Save ardenn/94e5729178429159d47eac24ceba83da to your computer and use it in GitHub Desktop.
Save ardenn/94e5729178429159d47eac24ceba83da to your computer and use it in GitHub Desktop.
Python Dictionaries Tutorial - Accessing items
# Using get() method
job2.get("title") # return 'Marketing & Business Development Manager'
job2.get("salary") # return None
# Passing a second argument to get()
job2.get("salary", 5000) # return 5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment