function:
def unique_common(a, b):
I have two lists, lets say:
a = [2, 3, 5, 7, 9]
and another list
b = [5, 8
Perhaps the solution would be to use NumPy, where the code should be very self-explanatory :
import numpy as np a = np.array([2,3,5,7,9]) b = np.array([5,8,4,1,11]) c = a*b d = np.sum(c) print(d)