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!

go back Advanced level
Bitecoin 4X

Will you be Pythonista #38 to crack this Bite?
Resolution time: ~56 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 5.0 on a 1-10 difficulty scale.
» Up for a challenge? 💪

Buy Now Login and get coding
We use Python 3.7