I want to take multiple lists and know the values that appaer in these lists with the possibility of one or more of the lists being empty.
CASE 1:
a = [1, 2, 3, 4, 5]
b = [9, 8, 7, 6, 5]
c = []
d = [2, 3, 5]
Needed output: 5
CASE 2:
a = [1, 2, 3, 4, 5]
b = [9, 8, 7, 6, 5, 3]
c = [1, 3, 8]
d = []
Needed output: 3
Order doesn't matter. I know I can use this if there are no empty lists (source 1 / source 2)
list(set(a) & set(b) & set(c) and set(d))
The problem occurs when one of the lists is empty.
Python version: 3.8