def factoria(n): if n == 1: return 1 else: return n * factoria(n-1) def power(x,n): if n == 0: return 1 else: return x * power(x, n-1) print(factoria(5)) print(power(3,3))
result:
120 27
def factoria(n): if n == 1: return 1 else: return n * factoria(n-1) def power(x,n): if n == 0: return 1 else: return x * power(x, n-1) print(factoria(5)) print(power(3,3))
result:
120 27