Identify this cell or stage of maturation:

Questions

Identify this cell оr stаge оf mаturаtiоn:

Uplоаd а Pythоn sоurce file (.py) thаt defines a function named affordable. This function will take as parameters a list of dictionaries and a float representing our spending budget, in dollars. This list contains dictionaries that each hold information about an ebay auction. The function will then return a single dictionary that will contain the information for the items which price is below our budget limit. We will, however, format this information differently: the key will be the name of the item and its corresponding value will be its price. See the examples below. Let us start by putting the following code in your global scope: auctions = [ { 'name' : 'Atari Falcon 030', 'price' : '499.99' }, { 'name' : 'Raspberry PI 400', 'price' : '50.45' }, { 'name' : 'Lenovo T480', 'price' : '200.59' }, { 'name' : 'Clockworks DevTerm', 'price' : '259.95' }, { 'name' : 'HP DevOne', 'price' : '759.85' } ] As you can see, the dictionaries in our list contain both the name of the items being listed (a string value corresponding to the key 'name' in that item's dictionary) and the price of the item (a string value corresponding to the key 'price' in that item's dictionary). We want our function to return a dictionary in which the keys are the names of the items (we'll have to avoid adding the items which name is already used as a key in the dictionary) and the values are their respective price, as a float. Please note that only the items that we can afford will make it to this dictionary. We can afford an item if its price is below the budget that we set as 2nd parameter. With the example above, calling our function on the auctions variable would return a dictionary structured as follows: >>> affordable(auctions, 300.0){   'Raspberry PI 400' : 50.45 ,   'Lenovo T480' : 200.59 ,   'Clockworks DevTerm' : 259.95 } Here is another example: >>> affordable(auctions, 51.0){   'Raspberry PI 400' : 50.45 } If we call our function with a negative budget or with an empty list of auctions, our function will return an empty list: >>> affordable(auctions, -300.0){}>>> affordable( [] , 300.0){} Of course if there are no affordable items, we also return an empty list. >>> affordable( [ { 'name' : 'ouch', 'price' : '9999.99' } ] , 300.0){} Here is an example where we have two items with the same name in our list of auctions. The function should add the first one but not the second one since its name is already used as a key in the resulting dictionary: auctions = [ { 'name' : 'Atari Falcon 030', 'price' : '499.99' }, { 'name' : 'Raspberry PI 400', 'price' : '50.45' }, { 'name' : 'Lenovo T480', 'price' : '200.59' }, { 'name' : 'Raspberry PI 400', 'price' : '49.95' },    { 'name' : 'Clockworks DevTerm', 'price' : '259.95' }, { 'name' : 'HP DevOne', 'price' : '759.85' } ] >>> affordable(auctions, 300.0){   'Raspberry PI 400' : 50.45 ,   'Lenovo T480' : 200.59 ,   'Clockworks DevTerm' : 259.95 } Notice how the "Raspberry PI 400' has been added only once to the resulting dictionary. The auction that was added is the first one that appeared in the list parameter. You are free to add more code to the global scope of your file in order to call your function to test it. This extra code will not be graded but will help you ensure that your function performs as expected. Grading Rubric: The function creates an empty dictionary named result to start off with (1 point) The function correctly iterates over all the dictionaries of the list given as parameter  (1 point) The function correctly detects items that are affordable (1 point) The function correctly adds these items to the result dictionary (1 point) The function correctly avoids adding the items which name has already been previously added in the dictionary (duplicates in the list parameter) (1 point) The function correctly returns an empty dictionary if no item is affordable (1 point) The function correctly returns an empty dictionary if it is given an empty list of dictionaries (1 point) The function correctly returns an empty dictionary if it is given a negative budget amount (1 point)