If you want the dot product with python. maybe or maybe not, it can be implemented as follows
a = [1, 2, 3]b = [4, 5, 6]result = 0for i, j in zip(a,b):result += i * j
but if you use itertools of python, you can write code as follows
import operatora = [1, 2, 3]b = [4, 5, 6]result = sum(map(operator.mul, a, b))
Why do you know itertools.
Code readability: As a simple example like dot product, the difference between two implementations is insignificant. But in the real world, more complexed list item with multiple for-loop make many developers tired.
Superior Memory performance: processing elements one at a time rather than bringing the whole iterable into memory all at once.
Let's read the official document. this post is based on the document.