Question: Problem 2 - Grocery List For this problem you are going to go grocery shopping. You need eggs, bread, butter, and milk, of course. So,


Problem 2 - Grocery List For this problem you are going to go grocery shopping. You need eggs, bread, butter, and milk, of course. So, keep a list of all of the things that you pick up in the grocery store. At the end, you should print out what you bought and also print out if you bought all of the required items, or if you still need something. Call the file grocery_list.py. This is not a complete listing, but it includes: - list slicing - Declaring your own Functions - Dictionaries creation using dict(), or \{\} , copying using dict(other_dict) .get(value, not_found_value) method accessing, inserting elements, removing elements. - break, continue - methods outside those permitted within allowed types for instance str.endswith list.index, list.count, etc. - Keywords you definitely don't need: await, as, assert, async, class, except, finally, global, lambda, nonlocal, raise, try, yield - The is keyword is forbidden, not because it's necessarily bad, but because it doesn't behave as you might expect (it's not the same as ==). - built in functions: any, all, breakpoint, callable, classmethod, compile, exec, delattr, divmod, enumerate, filter, map, max, min, isinstance, issubclass, iter, locals, oct, next, memoryview, property, repr, reversed, round, set, setattr, sorted, staticmethod, sum, super, type, vars, zip - If you have read this section, then you know the secret word is: argumentative. - exit() or quit() - If something is not on the allowed list, not on this list, then it is probably forbidden. - The forbidden list can always be overridden by a particular problem, so if a problem allows something on this list, then it is allowed for that
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
