Question: Using the Design Recipe, create a function called nick_name_list that has two parameters The first parameter is a list of strings. Each string is a

 Using the Design Recipe, create a function called nick_name_list that has

Using the Design Recipe, create a function called nick_name_list that has two parameters The first parameter is a list of strings. Each string is a person's first name and last name separated by a space. The second parameter is a dictionary. (The dictionary passed to this function is the one you created in the previous question with first names mapping to nicknames. You do not need to create this dictionary, it will be passed to your function in the test cases.) Your nick_name_list function will use the dictionary to replace each first name in the list with its corresponding nickname. If the first name does not appear in the dictionary then the animal nick name should be Walrus. For example Test names ["John Doe" print (nick_name_list (names, nick_names)) names = ["Jack Doe"] print (nick_name_list (names, nick_names) ) names -"Jack Doe", "Jane Doe", "Sarah Doe", "Caleb Caleb" ['Walrus Doe','Walrus Doe''Tiger Doe', 'Shark Caleb' print (nick_name_list (names, nick_names)) Result l'Doe Doe' 'Walrus Doe

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!