Advertisement
Guest User

Untitled

a guest
Jun 9th, 2020
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. class Figura():
  2. def __init__(self, x ,y):
  3. self.x = x
  4. self.y = y
  5.  
  6. def __add__(self, other):
  7. x=self.x+other.x
  8. y=self.y+other.y
  9. return Figura(x,y)
  10. def __sub__(self, other):
  11. x=self.x-other.x
  12. y=self.y-other.y
  13. return Figura(x,y)
  14.  
  15.  
  16. def __mul__(self, other):
  17. x=self.x*other.x
  18. y=self.y*other.y
  19. return Figura(x,y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement