function:
def unique_common(a, b):
I have two lists, lets say:
a = [2, 3, 5, 7, 9]
and another list
b = [5, 8
And also you can use map :
map
>>> a = [2, 3, 5, 7, 9] >>> b = [5, 8, 4, 1, 11] >>> sum(map(lambda x: x[0] * x[1], zip(a, b))) 160