Question: [PYTHON] I need help fixing the errors. Finish the function get_names that takes a list of dictionaries and returns a list of strings with the

[PYTHON]

I need help fixing the errors.

[PYTHON] I need help fixing the errors. Finish the function get_names that

Finish the function get_names that takes a list of dictionaries and returns a list of strings with the names from the dictionaries. The key for the first name is first and the key for the last name is las. Return a list of the full names (first last) as a string. If the first' or 'last key is missing in the dictionary use 'Unknown'. For example, [{'first': 'Ann', 'last': 'Brown'}, {'first': 'Darius'}] should return ['Ann Brown', 'Darius Unknown'] .. Run 2/16/2021, 1:19:29 PM - 4 of 4 Show in CodeLens 1 def get_names (d_list): 2 name_list = [] 3 for p_dict in d_list: 4 first = d_list.get('first', 'Unknown') 5 last = d_list.get('last', 'Unknown') 6 name = first + " " + last 7 name_list.append(name) 8 return name_list 9 10 11 12

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!