标签: python-3.7
my_list = [1, 2, 3, 3, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6] for item in my_list: if my_list.count(item) > 1: my_list.pop(item) print(my_list) # => actual result - [1, 2, 3, 4, 5, 6, 6, 6, 6]