Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write the function find Lowest Price that receives the 'prices 2D list as a parameter and finds the lowest gasoline price and displays the
Write the function find Lowest Price that receives the 'prices 2D list as a parameter and finds the lowest gasoline price and displays the countries with the lowest gasoline price among all the countries given in the 2D below: prices [['Libya', 0.03, 'Africa'], [Turkey', 1.64, 'Asia'], ['Qatar', 0.58, 'Asia'], ['Angola', 0.37, 'Africa'], ['Nigeria', 0.42, 'Africa'], ['Finland', 2.66, 'Europe'], ['Venezuela', 0.02, 'South America'], ['Algeria', 0.02, 'Africa'], [UK', 2.33, 'Europe']] In the main program, define your 2D list and make sure that you pass the correct parameter(s) to your function findLowestPriced and capture any returned values appropriately if any. Sample run: 2 countries have the cheapest price, just $0.02 per liter - Algeria -Venezuela Now modify the code of the previous problem so the findLowestPrice receives the 'prices' ID list instead of a 2D list as a parameter. The rest should be the same. The modified data structure: prices=['Libya', 0.03, 'Africa', 'Turkey', 1.64, 'Asia', 'Qatar, 0.58, 'Asia'], 'Angola', 0.37, 'Africa', 'Nigeria', 0.42, 'Africa', 'Finland', 2.66, 'Europe', 'Venezuela', 0.02, 'South America', 'Algeria', 0.02, 'Africa', 'UK', 2.33, 'Europe'] The sample run should be the same.
Step by Step Solution
★★★★★
3.51 Rating (151 Votes )
There are 3 Steps involved in it
Step: 1
Python program that defines the findLowestPrice function to find the lowest gasoline price among the countries and displays the countries with the low...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started