Get unordered unique elements from two lists python

Published: 14/01/2020
Get unordered unique elements from two lists python
Source: STACKOVERFLOW.COM

if i have two lists (may be with different len): x = [1,2,3,4] f = [1,11,22,33,44,3,4] result = > [11, 22, 33, 44] doing: for element in x: if element in f: f.remove(element) getting result = [11,22,33,44,4] set method return ordered collection but i need to keep order of elements. is there better way to do that?

Read more
Related news
Comment
FACEBOOK