Question: Recursion Write a recursive function that takes n as an input and returns nth power of 2. Write a recursive function that takes two numbers
Recursion
- Write a recursive function that takes n as an input and returns nth power of 2.
- Write a recursive function that takes two numbers m and n as an input and returns nth power of m.
def powerTwo(n): """ >>> powerTwo(5) 32 """
def powerN(___, ___): """ >>> powerN(3,4) 81 """
use python
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
