Python——函数:递归是神马

    技术2022-07-10  163

    def power(x, y): if y == 1: return x else: y = y - 1 return x * power(x, y) print(power(5, 2)) def gcd(x, y): if y == 0: return x else: temp = y y = x % y x = temp return gcd(x, y) print(gcd(4, 6))

     

    Processed: 0.024, SQL: 9