Question: In python please! Test file: $# Part B. is power_of # Define a function is power_of(1,3) that takes 2 ints i and j # and

$# Part B. is power_of # Define a function is power_of(1,3) that takes 2 ints i and j # and checks if i is a power of j or not # the function should return True indicating that i is a power of j A# otherwise return false edef is_power_of(i, j): # The only power of 1 # is 1 itself if i == 1: return j == 1 # Repeatedly compute # power of i power = 1 while power
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
