list1 = [1, 1, 2, 3]
list1.remove(1)
print(list1)
Output [1, 2, 3]
There's a pit here ,remove Will only delete 1 Time
list1 = [1, 1, 2, 3]
# First get the number of elements to be deleted in the list , How many elements to be deleted need to be executed how many times remove
for i in range(list1.count(1)): # list1.count(1) It's in the list 1 The number of
list1.remove(1)
print(list1)
Output [2, 3]