Question: Python Function name location_ideas Parameters: list of tuples Returns:; tuple Description: Now after you have registered your passport, you need to brainstorm what locations you
Function name location_ideas Parameters: list of tuples Returns:; tuple Description: Now after you have registered your passport, you need to brainstorm what locations you want to travel to. Write a function that takes in a list of tuples in the form (LOCATION (string), MILES AWAY (int). Return a tuple of the locations in order from closest (lowest miles away) to farthest (greatest miles away). If the list passed in is empty, return an empty tuple. No two locations will have the same distance. NOTE: You cannot use the lambda function. >>> aList = [("Paris. Franco", 4370), ("Shanghai, China", 12290), ("Quebec, Canada", 2207), (Orlando, Florida", 440) >> test1location_ideas(aList) >>> print(test1) (Orlando, Florida', 'Quebec, Canada', Paris, France', Shanghai, China') >>> bList = [("Austin, Texas", 960)) >>> test2 = location-ideas(blist) > print(test2) CAustin, Texas'.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
