OnlinePython

Updating Dictionaries Exercise

Question 1 of 5

You have a user profile that needs to be updated with new information. Some fields might already exist:

profile = {'name': 'Alice', 'age': 25}
new_data = {'age': 26, 'email': 'alice@example.com', 'city': 'Boston'}

Which method efficiently updates multiple fields at once?