As per the documentation the dictionary.get() is a built in method in Python and returns the value for key of it exists, else returns default.
dictionary.get(key, default=None, /)
For Example:
value = {"Name": "Harry", "Age": 17}
value["Name"]
Output
'Harry'
value.get("Name")
Output
'Harry'
value["Name"]
Output
'Harry'
When we try to access the key which is not present we get a key error.
value['Address']
Output
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-27-94bca0b4dfed> in <module>
----> 1 value['Address']
KeyError: 'Address'
using dictionary.get()
value.get('Address', 'not mentioned')
Output
'not mentioned'
Hope this helps.