Unit: Unit 5: Dictionaries and Sets • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Create dictionaries using {} literal and dict() constructor
user_profile = {
"username": "alex_dev",
"email": "alex@example.com",
"reputation": 450,
"is_active": True
}
empty_dict = {}
built_dict = dict(name="Jordan", role="Admin", level=5)
print("User Profile:", user_profile)
print("Empty Dict:", empty_dict)
print("Built Dict:", built_dict)
print("Total keys in profile:", len(user_profile))