Make the code into a function that takes the number and exponent as parameters and returns the result.