OnlinePython

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?