2. Remove the “apple” from the list.
3. Print the list.
4. Add "rabbit" to the list.
5. Print the list.
Right Answer:
# Step 1
animals = ["cat", "dog", "apple"]
# Step 2
animals.remove("apple") # Removing "apple" from the list
# Step 3
print(animals) # Output: ['cat', 'dog']
# Step 4
animals.append("rabbit") # Adding "rabbit" to the list
# Step 5
print(animals) # Output: ['cat', 'dog', 'rabbit']