Back to Lesson
Nested Dictionary Access
Navigate complex dictionary trees seamlessly.
Instructions
- Nested dictionary:.
db = {"users": {"u1": {"name": "Alice", "role": "Admin"}, "u2": {"name": "Bob", "role": "User"}}} - Access theof
"role"and print it."u1" - Change the name ofto
"u2"by mutating the dictionary in place."Robert" - Print the new name of.
"u2"
main.py
main.py
Ctrl + Enter