Python Tricks(十三)—— 欧几里得算法

def gcd(m, n): if n == 0: m, n = n, m while m != 0: m, n = n%m, m return n

    推荐阅读