Python remove list method - delete element from the list

The remove() method removes the first matching element (which is passed as an argument) from the list.
If a list contains duplicate elements, the remove() method only removes the first matching element.

Example:

my_list = ["comp sci", "physics", "elec engr", "philosophy"]
my_list.remove("physics")
print(my_list)
Output:
['comp sci', 'elec engr', 'philosophy']
If the element is not in list we will get the following error:
ValueError: list.remove(x): x not in list