Question: Given the following dictionary in Python: student _ data = { name: Alice, age: 1 5 , grade: A - } Perform the

Given the following dictionary in Python:
student_data ={
"name": "Alice",
"age": 15,
"grade": "A-"
}
Perform the following operations step-by-step and present your final code:
Check if the key "grade" exists in the student_data dictionary.
Print the value associated with the key "age" in the student_data dictionary.
Add a new key-value pair to the student_data dictionary, with the key "city" and the value "New York".
Print the updated student_data dictionary.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!