A list is an ordered, changeable collection of items.
fruits = ["apple", "banana", "cherry"]
numbers = [1, 2, 3, 4, 5]
mixed = [1, "hello", True, 3.14]
fruits = ["apple", "banana", "cherry"]
fruits[0] # "apple" (first item)
fruits[-1] # "cherry" (last item)
fruits[1:3] # ["banana", "cherry"] (slice)
fruits = ["apple", "banana"]
fruits.append("cherry") # Add to end
fruits.insert(0, "mango") # Insert at position
fruits.remove("banana") # Remove by value
fruits.pop() # Remove last
fruits[0] = "grape" # Change item
len(fruits) # Number of items
Interactive Visualization