id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs112fall2015 > recPower
prev  |  next  |  chance

Write a recursive function recPower(a, n) that returns the value of a raised to the nth power (i.e. a = a*a*...*a) without using the ** operator. You may assume n is non-negative.


recPower(2, 3) → 8
recPower(3, 2) → 9
recPower(8, 0) → 1

...Save, Compile, Run (ctrl-enter)

def recPower(a,n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy