Write the function find Lowest Price that receives the 'prices 2D list as a parameter and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Python program that defines the findLowestPrice function to find the lowest gasoline price among the countries and displays the countries with the low... View the full answer
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
Management, along with Supervision, is the process of achieving organizational objectives through people and other resources. The management hierarchy is generally as follows: top management provides...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
is a branch of computer science that focuses on creating computer systems or computer-controlled machines that have an ability to perform tasks usually associated with human intelligence. Natural...
-
A close company which prepares accounts to 31 March each year is owned and managed by a single shareholder/director who is not a Scottish taxpayer and who is paid a salary of 5,000 per month. In...
-
What is meant by sniping in an auction? Does it make sense to snipe to win an auction?
-
On October 1, 2024, Jenco signed a four-year, $100,000 note payable to Vicksburg State Bank in conjunction with the purchase of equipment. The note calls for interest at an annual rate of 12 percent...
-
1 The behaviour of participants in interracial interactions can be understood as initial stress reactions and subsequent coping responses. Identify the main sources of stress in interracial...
-
A new audit client of yours processes its sales and cash receipts documents in the following manner: a. Cash receipts. The mail is opened each morning by a mail clerk in the sales department. The...
-
Question 14 Operating profit is known as earnings after interest and taxes earnings before depreciation and taxes earnings before interest and taxes earnings after tax
-
"A truly random series will likely have a very small number of runs." Is this statement true or false? Explain your choice.
-
why is answer incomplete? please help P5-2 Preparing the Statement of Cash Flows (Indirect Method) LO5-1, 5-2, 5-3, 5-5, 5-7 Selected financial information for Frank Corporation is presented below....
-
Prove that Eq. (19.34) gives the simplest multi-gluon and gluon-quark states that contain an \(\mathrm{SU}(3)\) color singlet in the decomposition. Data from Eq. 19.34 (GG)1: (88)1 (Gqq) : [8 (383)8]...
-
In question 70, what is the probability that of the 100 cars test-driven, more than 35 cars get more than 45 miles per gallon? How many of the 100 cars tested would you expect to get more than 45...
-
Construct the braid group products (a) (b) using the algorithm of Fig. 29.16 . Data from Fig. 29.16
-
Worksheet The adjusted trial balance columns of a worksheet for Bond Corporation are shown below. The worksheet is prepared for the year ended December 31. Complete the worksheet by (a) entering the...
-
The Healthy Catering Service had the following transactions in July, its first month of operations: 1 Kelly Foster contributed \(\$ 18,000\) of personal funds to the business in exchange for common...
-
Need #2 VERSION 2 MASTER BUDGET TEMPLATE 1. Schedule of expected cash collections: Cash sales Credit sales Total cash collections "Given. January $100,000 224,000 $324,000 February March Quarter...
-
The Place-Plus real estate development firm in Problem 24 is dissatisfied with the economists estimate of the probabilities of future interest rate movement, so it is considering having a financial...
-
Return to the analysis of my undying love for my wife expressed through weekly purchases of roses (as introduced in end-of-chapter exercise 6.4). A. Recall that initially roses cost $5 each and, with...
-
Consider again the example of grade insurance. Suppose students know whether they are typically A, B,C, D or F students, with A students having a 75% chance of getting an A and a 25%chance of getting...
-
Consider the problem you face as a student as you determine how much to study for an exam by modeling yourself as a producer of an exam score between 0 and 100. A: Suppose that the marginal payoff to...
-
46. At the end ofYear 4, the city owed teachers $60,000 in vacation pay that had not been recorded. The assumption is that these vacations will be taken evenly over the next year. a. What is the...
-
45. Assume that the one component unit had program revenues of $30,000 and expenses of $42,000 and spent $10,000 for land during Year 4. However, it should have been handled as a blended com ponent...
-
43. On the first day ofYear 4, the city receives a painting as a gift that qualifies as a work of art. It has a 30-year life, is worth $15,000, and is being displayed at one of the parks. The...
Study smarter with the SolutionInn App