# Lists Mini Project — Shopping List
# add items, remove items, quit when done
# redhorndev.com

# ─────────────────────────────────────────────
# Setup
# ─────────────────────────────────────────────

shopping_list = []

# ─────────────────────────────────────────────
# Helper — print the current list
# ─────────────────────────────────────────────

def print_list(lst):
    if len(lst) == 0:
        print("Your list is empty.")
    else:
        print("\nYour list:")
        for item in lst:
            print(f"- {item}")

# ─────────────────────────────────────────────
# Main loop
# ─────────────────────────────────────────────

while True:
    print("\n1 — Add item")
    print("2 — Remove item")
    print("3 — Quit")
    choice = input("Your choice: ")

    if choice == "1":
        item = input("Item to add: ")
        shopping_list.append(item)
        print_list(shopping_list)

    elif choice == "2":
        item = input("Item to remove: ")
        if item in shopping_list:
            shopping_list.remove(item)
            print_list(shopping_list)
        else:
            print(f'"{item}" is not on your list.')

    elif choice == "3":
        print("List saved. Out.")
        break

    else:
        print("Invalid choice. Enter 1, 2, or 3.")
