my_list = [1, 2, 3, 4, 5]
print("Original List: ", my_list)
# Remove item at index 2
index_to_remove = 2
my_list.pop(index_to_remove)
print("List after removing item at index", index_to_remove, ":", my_list)
Original List: [1, 2, 3, 4, 5]
List after removing item at index 2 : [1, 2, 4, 5]
my_list
` with five items. We want to remove an item at a specified index (2 in this case) from the list. pop()
` method to remove an item from a list at a specified index. After removing the item, we print the list to verify that the item has been removed.