JJoeven

Exercises / math

Dot product

dot(a, b) is the sum of products. Raise ValueError if the lengths differ. Print dot of [1, 2, 3] with [0, 1, 0] and catch a length mismatch.

Live Pythonpython
Output
Run to execute this in your browser. Nothing is sent to a server.