Write a Python function to calculate dot product of two given sequence


Topic: Write a Python function to calculate dot product of two given sequence

Solution

def dot_product(a, b):
    return sum( e[0]*e[1] for e in zip(a, b))



List all Python Programs