Oct-06-2019, 02:50 PM
(This post was last modified: Oct-06-2019, 02:50 PM by no_named_nobody.)
(Oct-06-2019, 02:44 PM)buran Wrote: Please, don't post images of code. Copy/paste in python tags. See BBcode help for more info.Sorry, there is:
class MyVector: def __init__(self, a): self.a = a def get_vector(self): return(self.a) def __mul__(self, other): dot_product = 0 for x in range(len(self.a)): dot_product += self.a[x]*other.a[x] return dot_product