subject

Def is_power_of(number, base): # Base case: when number is smaller than base.
if number # If number is equal to 1, it's a power (base**).
return

# Recursive case: keep dividing number by base.
return ispowerof )

print(is power of (8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is power of (70,10)) # Should be False Restablecer

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 02:00
What is a loop? a. a collection of function definitions at the top of a program b. a line of code that defines a variable and assigns it a value c. a program that opens the turtle graphics window d. a block of code that repeats a specific number of times
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
Which type of cloud computing offers easily accessible software and applications on the machines
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
E-commerce builds on traditional commerce by adding the flexibility that networks offer and the availability of the internet. - true or false
Answers: 1
question
Computers and Technology, 25.06.2019 16:00
What is the play area? a. the frame editor b. the area the player will see in the game screen c. the area right next to an active object d. the area that keeps track of events in a game
Answers: 1
You know the right answer?
Def is_power_of(number, base): # Base case: when number is smaller than base.
if number # If...
Questions
question
Mathematics, 13.10.2020 09:01
question
Mathematics, 13.10.2020 09:01
question
Mathematics, 13.10.2020 09:01
Questions on the website: 13722367