I've got the following code;
#!/usr/bin/python
list1 = [[1,1,1,2], 2, [1,2,3,6], 3, 4, 5]
list2 = [1,1, [6,7], 7, 14 , 8, 9]
list3 = []
def check_match(l1,l2):
for i in l1:
if type(i) is list:
check_match(i,l2)
for j in l2:
if type(j) is list:
check_match(l1,j)
else:
if i == j:
list3.append(i)
print(list3)
The above code returns an empty list []
Essentially, what i'm trying to do is create a 3rd list which will contain only the unique values, which should look like this;
list3 = [1,2,3,4,5,6,7,8,9,14]
If anyone can guide me, that would be great.
Thanks guys