Question: Python script Needing to edit dictionaries is not very common, but sometimes it is useful. Write a function named get_older that consumes a dictionary (representing
Python script
Needing to edit dictionaries is not very common, but sometimes it is useful. Write a function named get_older that consumes a dictionary (representing a person) and increases its "Age" key's value by 1. The function should return the new age. Call the function on the two given person dictionaries to advance their ages, and print their returned values.
person1 = {"Name": "Charles Babbage", "Age": 17} person2 = {"Name": "Ada Lovelace", "Age": 32}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
