2 Topics

Member Avatar for
Member Avatar for kxjakkk

Python keeps getting stuck on this line because there is no attribute "numerator" (and I'm assuming it'd say it has no attribute for denominator either). third = Rational(25, 10) print ("third: 0/1".format(third.numerator(), third.denominator())) For my Rational class, I've got def gcd(a, b): if b == 0: return a else: return …

Member Avatar for Schol-R-LEA
0
623
Member Avatar for MrHardRock

Hey everyone, I recently had the assignment to write a recursive program to calculate greatest common denominator. I barely understood recursion when our instructor explained it to us. I understood how it works and calling on itself I am just bad at implementing it. I think I almost got my …

Member Avatar for MrHardRock
0
287

The End.