17 Dec PMCA Sunday 10:00 Practice -32.
Question:
Please modify the fraction class we made in the class by adding a method called add(). The method will take 2 arguments top and bottom like:
def add(self, top, bottom):
so the fraction object can add another fraction top and bottom number, such as:
a = Fraction(3, 5)
a.add(1, 6)
print(a)
it will display 23 / 30
Sorry, the comment form is closed at this time.