I was wodnering if there was any way to find the common elements of three lists, whilst ignoring a list that is empty among the three. For example I know that:
a = ['a', 'b', 'c', 'd']
b = ['a', 'v', 'd', 'g']
v = ['d']
>>> set(a).intersection(b, v)
{'d'}
but I was wondering if there was a way to do this:
a = ['a', 'b', 'c', 'd']
b = ['a', 'v', 'd', 'g']
v = []
>>> comparison_method(a, b, v)
{'a', 'd'}
Or if 2 out of 3 lists were empty, it would just return the list that wasn't.