TypeError: unsupported operand type(s) for -: ‘list’ and ‘list’
You can’t subtract a list from a list. >>> [3, 7] – [1, 2] Traceback (most recent call last): File “<stdin>”, line 1, in <module> TypeError: unsupported operand type(s) for -: ‘list’ and ‘list’ Simple way to do it is using numpy: >>> import numpy as np >>> np.array([3, 7]) – np.array([1, 2]) array([2, 5]) …