更新:一旦我不知道3 %4 =0
...
def gcd(a, b):
"""Calculate the Greatest Common Divisor of a and b.
Unless b==0, the result will have the same sign as b (so that when
b is divided by it, the result comes out positive).
"""
while b:
a, b = b, a%b
return a
我认为它是这样工作的:
gcd(3,4) => while 4: => 3,4 = 4, 3%4 =>