GH avatar Bite 58. Using argparse to interface with a grocery cart

Below is a Groceries class with add/delete/show/search methods.

You as a Python Developer are asked to give your users a command line interface so they can use the program. In real life we would have a persistent DB behind it, but let's focus on practicing argparse.

If new to argparse you might want to check out Bites 56 and 57 first.

The program should work as shown here.

Good luck and have fun!

Will you be Pythonista #30 to crack this Bite?
It takes an average of ~58 minutes to solve this Bite (submissions 5-240 min).
Pythonistas rate this Bite 3.0 on a 1-10 difficulty scale.
» You can do it! 😌

Buy Now Login and get coding
We use Python 3.7