Question: Write a general purpose user defined function that removes all duplicates from a list and then sorts it. The function will return a cleaned-up, sorted
Write a general purpose user defined function that removes all duplicates from a list and then sorts it. The function will return a cleaned-up, sorted list to the calling code. The calling code will then print the returned list. Test your function using the following lists. Be sure your code works for all of them: fruits = ['apple', 'banana' , 'cherry' banana' , 'orange , i, 'apple' , 'apple , 'mango' , 'mango' 'orange', 'kiwi' , 'raspberries' ] morefruits = ['nectarines', 'apricots', 'peaches', grapefruit', 'mandarin', 'lime' 'nectarines' , 'apricots', 'peaches' 'grapefruit', 'mandarin', 'lime' grapefruit', 'mandarin', 'lime' , cities = ['Florence' , 'Huntsville, 'Birmingham', 'Mobile', 'Montgomery' 'Muscle Shoals", 'Huntsville', 'Birmingham', 'Montgomery' , 'Mobile', 'Tuscaloosa', 'Hoover' , 'Auburn' , 'Dothan' , 'Decatur', 'Madison', 'Montgomery' , 'Muscle Shoals', 'Huntsville', 'Birmingham", 'Montgomery' , 'Mobile' 'Tuscaloosa' , 'Hoover' , ] Test and debug your code. Upload your program to this assignment
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
