Py学习  »  Python

Python 3为什么不返回[duplicate]

richardR • 5 年前 • 1111 次点击  

为什么不退货? 当a或b为0时,必须返回max(a,b)

def gcd(a, b):
if a == 0 or b == 0:
    return max(a, b)
else:
    if a > b:
        gcd(a-b, b)
    else:
        gcd(b-a, a)

印刷品(gcd(1000400))

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/55962
 
1111 次点击  
文章 [ 1 ]  |  最新文章 5 年前