manyspikes

Challenge 2: Dot product

Initialising environment...

Instructions

Define a function called dot that computes the dot product between two vectors.

As a reminder, the dot product can be computed by summing the result of multiplying the vectors element-wise.

The function should take as input two vectors, each vector being represented by a list of numeric values, and return the dot product between them.

The function should be implement such that

dot([1, 2, 3], [3, 4, 5])

returns 26.

Note that the function should work for vectors of any dimensionality, i.e. the input lists can be of any size, as long as the two input lists have the same number of elements.