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-
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)
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
Step: 1
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