> For the complete documentation index, see [llms.txt](https://www.pythonclassroom.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pythonclassroom.com/lists/lists-strings/shopping.md).

# Shopping Project

## Video Lecture

{% embed url="<https://youtu.be/SW3A-S3IgiI>" %}

## Problem

You want to go shopping for computers and electronics.  Create two lists.  One for the name of the items and other for the cost of the items. &#x20;

* Create a menu item S that lists the items for sale and the cost
* Create a menu item P that asks the user for 3 items to purchase and their prices.
* Create a menu item C that print the items the user purchases and the total price.
* Create a menu item Q that quits the program.

![](/files/-M8Chk7345EpU-XWWiUk)

![](/files/-M8CfeE37CDnKgWtvyii)

![Source: Best Buy](/files/-M8CfvgJF_tePDRpVJpX)

## Example Code

```python
shopping_list = []
shopping_cost = []
done = False
while not done:
    print("Shopping Program")
    print("S - Shop")
    print("P - Purchase")
    print("C - Checkout")
    print("Q - Quit")
    choice = input("Choice: ")
    if choice == "S":
        print("Items available to purchase")
        print("Animal Crossing $59.99")
        print("Skullcandy Headphones $29.99")
        print("Beats by Dr Dre $199.99")
        print("HP 15.6\" touchscreen laptop $499.99")
        print("ASUS 14\" touchscreen laptop $599.99")
        print("Samsung 13.3\" touchscreen laptop $849.99")
        print("HP ENVY x360 $799.99")
    elif choice == "P":
        for x in range(3):
            add_shopping_list = input("Name of Item: ")
            shopping_list.append(add_shopping_list)
            add_shopping_cost = float(input("Cost of Item: "))
            shopping_cost.append(add_shopping_cost)
    elif choice == "C":
        print("Items Purchased")
        for x in shopping_list:
            print(x)
        print("Total: ",sum(shopping_cost))
    elif choice == "Q":
        print("Quitting")
        done = False
    else:
        print("Invalid Choice")
        
```

### Sample Output

![](/files/-M8MW0YZRNOC2lWdZ39P)

![](/files/-M8MW9X0A2atUih-6neL)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.pythonclassroom.com/lists/lists-strings/shopping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
