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

 

gaurav1780@gmail.com 03_loops > is_perfect_power
prev  |  next  |  chance

Complete the function that when passed an integer (say, n), returns True if it is a "perfect power", that is, there exist two integers, k and p, such that p > 1, and k to the power of p = n. Note: 0 and 1 are considered perfect powers since 0 to the power of any value is 0, and 1 to the power of any value is 1.


is_perfect_power(6561) → True
is_perfect_power(80) → False
is_perfect_power(0) → True

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

def is_perfect_power(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: 4

Copyright Nick Parlante 2017 - privacy