For Project 6, we'll be creating a Shopping List program in Python.
You'll continue to learn more concepts in Python as well as reinforce some of the software development steps from the previous projects.
By the end of this project, you will have gained valuable experience and foundational skills that will be useful for future projects:
Learn how dictionaries work as key-value pairs.
Understand how to create, access, modify, and delete dictionary entries.
Discover how to organise complex data structures by storing dictionaries in a list.
Practice adding, updating, and removing dictionary items within a list.
Develop skills in searching for items within a list of dictionaries.
Listen to Tony below, he has a program he wants you to build. If you're still not sure afterwards, you can chat with him using the chatbot below.
📖 Afterwards, write down four requirements into your workbook, in plain-English, that you think Tony wants you to include in the program.
An example of this might be: "The program should greet the user and explain that it is a Shopping List".
📖 In your workbook create IPO Diagrams for three functions in your program.
An IPO diagram stands for Input-Process-Output, and it's a simple way to outline what a program needs to do.
Input: What the function receives as input (user input or other).
Process: The steps or logic the function performs.
Output: The result or response produced by the function.
You will need to identify the core functions of your program based on the requirements.
An example (display_menu) has already been provided.
Design is your game plan. Before you start coding, you sketch out what steps your program needs to take and how it should flow.
📖 In your workbook, complete the screen design and pseudocode activities.
Now comes the fun part: actually making your program. This is where you write the code. Open the assignment in GitHub Classroom.
There are three labs to complete in order to learn the concepts necessary to complete this project. Complete these first.
Create and use dictionaries in Python.Â
Get set up on GitHub with Project 6
Lab 2 - Lists and Dictionaries
Use Lists and Dictionaries together in Python.
Learn how to create and use data dictionaries.
Less Comfortable:
Use both lists and dictionaries
Store item and quantity
Add and remove items
Use a menu system
Use input validation
More Comfortable
Sort the list
Update items
Search functionality
Store additional properties such as price
Extensive input validation and error handling
Accurate Logic Implementation: Ensure that the code accurately performs the tasks it's meant to. For example, the add_item function should correctly add an item without duplicating it.
Robust Error Handling: The code should gracefully handle unexpected or incorrect inputs. For instance, entering a string where a number is expected should not crash the program.
Clarity in User Interface: The program should be easy to navigate, with clear instructions and prompts. For example, menu options should be straightforward, guiding the user on what to do next.
Responsive Feedback: The program should provide immediate and clear feedback for user actions. For instance, after adding an item, it should confirm the action or alert if the item already exists.
📖 Complete the peer code review activity in your workbook.
Go back through your program and ensure it is maintainable by using code commenting and meaningful variable names.