Created
October 1, 2018 17:54
-
-
Save ardenn/94e5729178429159d47eac24ceba83da to your computer and use it in GitHub Desktop.
Python Dictionaries Tutorial - Accessing items
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
# 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