Multi-level Dictionaries Exercise
Question 1 of 5
You need to safely access user theme settings that might not exist:
users = {
'alice': {'preferences': {'theme': 'dark'}},
'bob': {'profile': {'name': 'Bob'}}
}Which approach safely gets the theme for any user?
users.get(user_id)['preferences']'theme'
users[user_id]['preferences']'theme'
usersuser_id.get('preferences').get('theme')
users.get(user_id, {}).get('preferences', {}).get('theme', 'light')