# Basic syntax:
my_list.remove(element) # or:
my_list.pop(index)
# Note, .remove(element) removes the first matching element it finds in
# the list.
# Example usage:
animals = ['cat', 'dog', 'rabbit', 'guinea pig', 'rabbit']
animals.remove('rabbit')
print(animals)
--> ['cat', 'dog', 'guinea pig', 'rabbit']
# Note only the first instance of rabbit was removed from the list.
# Note, if you want to remove all instances of an element (and it's the only
# duplicated element), you could convert the list to a set then back to a
# list, and then run .remove(element) E.g.:
animals = list(set['cat', 'dog', 'rabbit', 'guinea pig', 'rabbit'])
animals.remove('rabbit')
print(animals)
--> ['cat', 'dog', 'guinea pig']