Question: 012 Swap names. Complete the following function according to its docstring. Note: this function should return None. Its job is to modify the list passed

 012 Swap names. Complete the following function according to its docstring.

012 Swap names. Complete the following function according to its docstring. Note: this function should return None. Its job is to modify the list passed as its argument. def swap_name (name_list: List[str]) -> None: """name_list contains a single person's name. Modify name_list so that the first name and last name are swapped. >>> name = ['John', 'Smith'] >>> swap_name (name) >>> name [ 'Smith', 'John'] >>> name = ['John', 'Andrew', 'Gleeson', 'Smith'] >>> swap_name (name) >>> name [ 'Smith', 'Andrew', 'Gleeson', 'John']

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!