Question: Using python. fruit_list = [[apple,A,1], [pear,B,2], [grapes,C,3]] #This corresponds to fruit, cashier, cost sortFruits( fruit_list, input_sort): takes the parameters, fruit_list and input_sort (string for cashier

Using python.

fruit_list = [["apple","A",1], ["pear","B",2], ["grapes","C",3]] #This corresponds to fruit, cashier, cost

sortFruits( fruit_list, input_sort): takes the parameters, fruit_list and input_sort (string for cashier or integer for cost) to filter the fruits. If input_sort is a string like "A", then only shows the fruits check out by cashier-A. If cashier is not found then print ("Decline: cashier- not found.).

If input_sort is an integer like 1, then only shows fruits that cost more than that (if there's none, print "None")

*sortFruits shouldn't change fruit_list.

The print statement for sortFruits should look like this: (if the argument is true)

, cash out by , cost dollars.

And the function calls is : sortFruits(fruit_list, 'B') or sortFruits(fruit_list, 1)

How the code should start:

def sortFruits(fruit_list, input_sort)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!