TORONTO KIDS COMPUTER CLUB | PMCA Sunday 10:00 Practice -32.
18871
post-template-default,single,single-post,postid-18871,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

PMCA Sunday 10:00 Practice -32.

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

No Comments

Sorry, the comment form is closed at this time.