Question: Write a general purpose user defined function that removes all duplicates from a list and then sorts it. The function will return the 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 the 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', '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',]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
