Question: Which of these functions is a recursive program that correctly calculates the power of a number raised to another ( a ^ b ) ?
Which of these functions is a recursive program that correctly calculates the power of a number raised to another ab
a
def powerab:
if b :
return a
else:
return apowerba
b
def powerab:
if b :
return a
else:
return apowerab
c
def powerab:
if b :
return a
else:
return apowerab
d
None of these
e
def powerab:
if b :
return a
else:
return apowerba
f
def powerab:
sm
for i in rangeb:
sma
return sm
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
