```
def ipow(x, n):
if n == 0:
return 1
else:
original = num
for i in range(n-1):
num *= original
n -= 1
return num
def rpow(x, n):
if n == 0:
return 1
else:
return num*rpow(num, n-1)
```

""" runtime beats 99% submissions, I did not consider negative n but it is easy, just return 1/num is enough"""