Unit: Unit 4: Strings, Lists, and Tuples • Interactive Practice
Interactive Python programming tutorial and practice in your browser.
# Grow the inventory list dynamically using append()
inventory = ["laptop", "wireless mouse", "mechanical keyboard"]
# 1. Add "monitor" to the end of the list
inventory.append("monitor")
# 2. Add "webcam" to the end of the list
inventory.append("webcam")
print("Inventory after append operations:", inventory)
print("Total items:", len(inventory))