The power function declaration is superfluous. Python's built in pow() takes care of powers, and is functionally equivalent to power(). They both return integers when integers are provided as well.
After declaring power(), this code can guarantee the functions are similar (at least with ints. With some floats, power() will throw an exception):
>>> for x in range(0, 20):
... for y in range(0, 20):
... assert power(x, y) == pow(x, y)
The power function declaration is superfluous. Python's built in pow() takes care of powers, and is functionally equivalent to power(). They both return integers when integers are provided as well.
After declaring power(), this code can guarantee the functions are similar (at least with ints. With some floats, power() will throw an exception):