Question: Python: Dictionary user _ ages contains four key - value pairs. Read a string from input, representing a key found in user _ ages. Then,

Python: Dictionary user_ages contains four key-value pairs. Read a string from input, representing a key found in user_ages. Then, assign the value associated with the key read with the current value minus 4.
Ex: If the input is Abe, then the output is:
Original:
{'Bob': 14, 'Ben': 32, 'Abe': 42, 'Gus': 48}
Updated:
{'Bob': 14, 'Ben': 32, 'Abe': 38, 'Gus': 48}

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!