Mini Project: Shopping List Manager
Project Overview:
We will create a Python program that allows users to manage a shopping list. Users will be able to add items, remove items, and view their list.
Project Requirements:
User Input:
- The name of the item to add to the shopping list.
- The name of the item to remove from the shopping list (if applicable).
Conditional Statements:
- Before removing an item, the program will check if the item exists in the list and display an appropriate message if it does not.
- The program will inform the user if the list is empty when attempting to view or modify it.
Output:
- A confirmation message when an item is successfully added or removed.
- A summary of the current shopping list
- A message when exiting the program.
Lesson 2
Learning Intention:
- I can convert my decision tree in to a functioning python program.
- I understand how to use a main loop to have my program run until the user terminates it
- I understand how to use functions to break my program in to clear sections for efficiency and usability.
| Activity | Description | Assessment Criteria |
|---|---|---|
| Program Implementation |
We can implement our shopping list program by coding each section as its own function.
We also need a main loop which will continue to run our program until the user chooses to exit.
Creating functions and the main loop In order to create the functions and the game loop we will need to name each function and give it some basic code to execute so we can see that it is working. The below code shows how to set up your 4 functions. Remember these functions won't run until they are called. That's the next step. Now that we have these functions we need to set up a loop that will continuously run our program until the user chooses to exit. At the top of the program i'm going to create a variable called "exit" and set it to false.
For the rest of the lesson work with your teacher to get your main loop functioning properly and include your remaining menu options in the loops conditional statement. Next lesson we will finish the shopping list. |
proficient implementation of a program that includes functioning and purposeful use of iteration, conditional statements, functions, variables and user input. |