[Python]
请问这个程序设计里面怎么确保分子分母的因数只有1呀~
Design a class
[Python] 请问这个程序设计里面怎么确保分子分母的因数只有1呀~ Design a class ‘fractions’ so that the fractions can be directly added and subtracted like integers. For example, 2/1+3/5=13/5, and make sure that the numerator and denominator do not have a common factor greater than 1.(hint: overwrite __str__, __add__, __sub__ methods)……