list1=[1,2,3,3,4,'John','Ana','Mark','John']
#方法1
def remove_duplicate(list_value):
return list(set(list_value))
print(remove_duplicate(list1))
#方法2
result=[]
[result.append(x) for x in list1 if x not in result]
print(result)
[1, 2, 3, 4, 'Mark', 'Ana', 'John']
[1, 2, 3, 4, 'John', 'Ana', 'Mark']
还可以输入200个字
蝈蝈派【海南省教改项目(Hnjg2022-80)支持】 网站版权所有
Python remained the copyright of our website