class ShoppingCart:
def __init__(self):
self.items = []
def add_item(self, item_name):
self.items.append(item_name)
def show_items(self):
print(self.items)
mycart = ShoppingCart()
mycart.add_item("apple")
mycart.add_item("banana")
mycart.show_items()
To embed this project on your website, copy the following code and paste it into your website's HTML: