Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago