Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Allowed Functions - list functions: append() - string functions: strip(), split() - other built-in functions or techniques: len(), range(), ain(), in keyword, string/list slicing [[start:stop:step])

image text in transcribed

Allowed Functions - list functions: append() - string functions: strip(), split() - other built-in functions or techniques: len(), range(), ain(), in keyword, string/list slicing [[start:stop:step]) Please do NOT use functions that we have not discussed in this class. Required Tasks dining_hall_menus.py Create a new file called dining_hath_menus-py, where you will implement the function: def dining_hall_menus (ovt_nenu, pines_menu) The function will take in 2 lists, ovt_menu and pines_menu and returns the difference between the two menus offered that day. We define the "difference" between two menus as a list of unique items that one menu has but the other menu doesn't. For example, the function call dining_hall_menus(["pizza", "spaghett1", "salad", "fries"], ["burgers", "sushi", "fries", "pizza"]) would retum ["spaghett1", "salad", "burgers", "sushi"]. Note the following: - Items in the menus must match the exact capitalization to be considered as the same. For example, the function call dining_hall_nenus(["p1zza"], ["P1zza"]) would return ["plzza", "p1zza"]. - ovt_menu and pines_menu may have duplicates within the list, but will be treated as one item. For example, the function call diming_hall_menus(["pizza", "salad", "salad"], ["p12za"]) would return the list ["salad"]. - Empty lists are valid arguments, passing in a single empty list and a non-empty list should return a list of the unique items in the non-empty list. For example, the function call dining_hall_menus([], ["fries", "fries"]) would return ["fries"]. Passing in two empty lists would return an empty list. - Order of the items in the returned list does not matter

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

Students also viewed these Databases questions