Question: Would love a push in the right direction with this python question. def city likes(self, cities, likes): Creates and returns a new dictionary whose keys
def city likes(self, cities, likes): Creates and returns a new dictionary whose keys corerspond to the keys in the cities dictionary. The corresponding values in the new dictionary are the values in cities but modified by the values in the likes list. cities: dictionary with the following keys and values key: alphabetic lowercase string, city name value: non-negative integer (1 or larger), number of likes likes: list of integers (can be negative) has the same size as cities Returns: new dictionary key: alphabetic lowercase string - same as in cities) value: corresponding value in cities to which we add the corresponding value in the likes list Exammple city likes[{'boston': 50, 'manchester': 50}, (-10, 10]) returns {'boston': 40, 'manchester': 60} pass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
