Question: 22d. postal_routing.py Write a function postal_routing(item_to_address, zip_code_to_delivery_bin) where item_to_address maps an item id to a street address and zip_code_to_delivery_bin maps a zip code to its

22d. postal_routing.py

Write a function postal_routing(item_to_address, zip_code_to_delivery_bin) where item_to_address maps an item id to a street address and zip_code_to_delivery_bin maps a zip code to its postal delivery bin. Use item_to_address and zip_code_to_delivery_bin to create a new dictionary that maps an item id to its delivery bin.

For example:

item_to_address = {"Violin": "221B Baker St.,London,5208", "Cheese": "62 West Wallaby Street,Wigan,Lancashire,227", "Umbrella": "17 Cherry Tree Lane,London,5208", "Spatula": "124 Conch Street,Bikini Bottom,Pacific Ocean,12345"}zip_code_to_delivery_bin = {5208: 16, 227: 76, 12345: 1}postal_routing(item_to_address, zip_code_to_delivery_bin)

Would return:

{"Violin": 16,"Cheese": 76,"Umbrella": 16,"Spatula": 1}

e. assign_convocation_room.py

Write a function assign_convocation_room(name_to_major, major_to_college, college_to_room) where name_to_major maps a students name to their major, major_to_college maps a major to its department/college, and college_to_room maps a college/department to the room number where their meeting will be held. Use these three dictionaries to create a new dictionary that maps each student to their assigned room number.

For example:

name_to_major = {"Jimmer Fredette": "American Studies", "Brandon Sanderson": "English", "Lindsey Stirling": "Recreation Management"}major_to_college = {"American Studies": "Humanities", "English": "English", "Recreation Management": "Recreation Management"}college_to_room = {"Humanities": 377, "English": 322, "Recreation Management": 258}assign_convocation_room(name_to_major, major_to_college, college_to_room)

Would return:

{"Jimmer Fredette": 377, "Brandon Sanderson": 322, "Lindsey Stirling": 258}

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 Programming Questions!