I wondering how i would enter multiple variables into my function:
def Dot_Product(Vector1,Vector2):
return sum([x*y for x,y in zip(Vector1,Vector2)])
print Dot_Product([1,2,1],[1,1,1])
I have looked into *args and **kwargs but I'm not sure how I would implement this so that the list comprehension would also iterate over an unknown number of variables. I'm not sure if its possible so if there are any alternatives, they would be greatly appreciated. I understand how *args and **kwargs work however I'm unsure how to implement a list comprehension that would iterate over an unknown number of variables as in the example given i can only iterate over x,y or x,y,z or n number of lists lists at any one as long as I know what number n is. Since i don't know n how can i change the list comprehension to handle that?