Can you help me for removing duplicate items in a list in python3 please ?
for example the input list is :
['2001', '0', '3c4d', '15', '0', '0', 'db8', '1a2b']
and output :
['2001', '0', '3c4d', '15', 'db8', '1a2b']
Can you help me for removing duplicate items in a list in python3 please ?
for example the input list is :
['2001', '0', '3c4d', '15', '0', '0', 'db8', '1a2b']
and output :
['2001', '0', '3c4d', '15', 'db8', '1a2b']
OUTPUT = list(set(INPUT))
To preserve order:
OUTPUT = list(dict.fromkeys(INPUT)) # Credit to @Jab
Converts to a set of unique items, then back into list form.