Question: use python to solve please Complete the get_shortest_name function which is passed a list of strings as a parameter. The function returns the word in
Complete the get_shortest_name function which is passed a list of strings as a parameter. The function returns the word in the list which has the least characters (i.e the shortest name). If two or more words in the list have the same number of characters as the shortest name, the function should return the first name from the start of the list which has the least characters. If the parameter list is empty, the function should return an empty string. For example: Test Result print ("1.", get_shortest_name(["Candide", "Jessie", "Kath",1. K "Amity" "Raeanne"])) ath Answer: (penalty regime: 0 %) 1 |def get_shortest name(list_)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
