id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

Athenian: Loopswhile4

prev  |  next  |  chance

Determine the value returned by the function.
by Bernie '21

def power_find(x, y):
    i = 1
    init_x = x
    while x < y:
        x *= init_x
        i += 1
    if x == y:
        return i
    else:
        return 0
Function Call  Return Value
power_find(2,8)
power_find(4,64)
power_find(3,71)
power_find(6,20)

Experiment with this code on Gitpod.io

⬅ Back