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

 

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

Write a for loop to compute the the first parameter raised to the power of the second. Don't use ** to compute powers for this problem.


power(5, 2) → 25
power(6, 0) → 1
power(7, 1) → 7

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

def power(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

Difficulty: 105 Post-solution available

Copyright Nick Parlante 2017 - privacy