32 lines
581 B
Python
32 lines
581 B
Python
class Rational:
|
|
def __init__(self, numer, denom):
|
|
self.numer = None
|
|
self.denom = None
|
|
|
|
def __eq__(self, other):
|
|
return self.numer == other.numer and self.denom == other.denom
|
|
|
|
def __repr__(self):
|
|
return f'{self.numer}/{self.denom}'
|
|
|
|
def __add__(self, other):
|
|
pass
|
|
|
|
def __sub__(self, other):
|
|
pass
|
|
|
|
def __mul__(self, other):
|
|
pass
|
|
|
|
def __truediv__(self, other):
|
|
pass
|
|
|
|
def __abs__(self):
|
|
pass
|
|
|
|
def __pow__(self, power):
|
|
pass
|
|
|
|
def __rpow__(self, base):
|
|
pass
|