Question: pytthon (syder) 5. Free Response: splitPower(x, n) [2pts] Write the function splitPower(x, n) where x and n are integers, and n is non-negative. This function
5. Free Response: splitPower(x, n) [2pts] Write the function splitPower(x, n) where x and n are integers, and n is non-negative. This function removes the n rightmost digits of x, leaving or more leftmost digits. The function then returns the number formed by the leftmost digits raised to the power of the rightmost digits. For example, splitPower(23, 1) returns 8, because 2**3 == 8. Likewise, splitPower(123, 2) returns 1, because 1** 23 == 1. Note that splitPower(-902, 2) returns 81 because (-9)**2 == 81. Be careful with negative numbers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
