Skip to content
CodeItRaw
Code Reading
/
Power
Path
Play
Daily
Leaderboard
tr
Bug Hunt
Power
power(2, 3) correctly gives 8, but power(5, 0) never ends (RecursionError). Find the line and the kind of bug.
Click the line you think is wrong.
1
def
power
(base, exp):
2
if
exp ==
1
:
3
return
base
4
return
base * power(base, exp -
1
)