Skip to content
Snippets Groups Projects
Commit b50e5e0b authored by Санников Тимофей's avatar Санников Тимофей
Browse files

minor changes

parent 0d77d44a
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,7 @@ class Rectangle:
return (self.x2-self.x1)*(self.y2-self.y1)
def __mul__(self, item):
return self.__class__(self.x1*item, self.y1*item, self.x2*item, self.y2*item)
def __rmul__(self, item):
return self.__class__(self.x1*item, self.y1*item, self.x2*item, self.y2*item)
__rmul__ = __mul__
def __getitem__(self, item):
if item > 3:
raise IndexError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment