Lists

fruits = ["apple", "banana", "orange"]
print(fruits[0])  # Output: "apple"
print(fruits[1])  # Output: "banana"
apple
banana
fruits[2] = "grape"
print(fruits)  # Output: ["apple", "banana", "grape"]
['apple', 'banana', 'grape']
fruits.append("kiwi")  # Add an item to the end of the list
print(fruits)  # Output: ["apple", "banana", "grape", "kiwi"]

fruits.remove("banana")  # Remove a specific item from the list
print(fruits)  # Output: ["apple", "grape", "kiwi"]
['apple', 'banana', 'grape', 'kiwi']
['apple', 'grape', 'kiwi']
CTRL + ENTER to send