Open this example in the interactive library
Source code
settings = {'theme': 'dark'}
print(settings.get('language', 'en'))Sample output
en

Read a default value. A self-contained example using the Python standard library.
Open this example in the interactive library
settings = {'theme': 'dark'}
print(settings.get('language', 'en'))en