>>> def gcd(m,n):
if m%n==r and n !=0 and r !=0:
return gcd(m,n)==gcd(n,r)
elif n==0 or r==0:
return gcd(m,0)==1
else:
print None
gcd(5,6)
Traceback (most recent call last):
File "<pyshell#35>", line 1, in <module>
gcd(5,6)
File "<pyshell#34>", line 5, in gcd
return gcd(m,0)==1
File "<pyshell#34>", line 2, in gcd
if m%n==r and n !=0 and r !=0:
ZeroDivisionError: integer division or modulo by zero
抱歉,我刚刚将其修改为另一个版本,但仍然收到类似的错误消息...非常感谢大家!