1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kay [80]
3 years ago
15

"Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that

both arguments to is_power are positive integers. Note that the only positive integer that is a power of "1" is "1" itself. After writing your is_power function, include the following test cases in your script to exercise the function and print the results: print("is_power(10, 2) returns: ", is_power(10, 2)) print("is_power(27, 3) returns: ", is_power(27, 3)) print("is_power(1, 1) returns: ", is_power(1, 1)) print("is_power(10, 1) returns: ", is_power(10, 1)) print("is_power(3, 3) returns: ", is_power(3, 3)) You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code. Your submission will be assessed using the following Aspects. A. Does the submission include the is_divisible function from Section 6.4 of the textbook? B. Does the submission implement an is_power function that takes two arguments? C. Does the is_power function call is_divisible? Does the is_power function call itself recursively? D. Does the is_power function include code for the base case of the two arguments being equal? E. Does the is_power function include code for the base case of the second argument being "1"? F. Does the submission include correct output for the five test cases"

Arts
1 answer:
statuscvo [17]3 years ago
7 0

Answer:

The explanation of this program is written below in explanation section

Explanation:

def Is_Power(x,y):#defining power function

   print(pow(x,y));#using built-in "pow(base,exp)" function

Is_Power(10,2)#checking 10 raise to power 2  

Is_Power(27,3)#checking 27 raise to power 3  

Is_Power(1,1)#checking 1 raise to power 1

Is_Power(10,1)#checking 10 raise to power 1

Is_Power(3,3)#checking 3 raise to power 3

# however, it is noted that this symbol is used for comments

# Is_Power(10,2) is equal to 100  

# Is_Power(27,3) is equal to 19683

# Is_Power(1,1) is equal to 1

# Is_Power(10,1) is equal to 10

# Is_Power(3,3) is equal to 27

You might be interested in
Describe two elements of the above painting that the artist included to create perspective?
valkas [14]

Answer:

The artist uses shading, action, and tone

Explanation:

5 0
3 years ago
Integrity is __________. *
Bad White [126]

Explanation:

Integrity is??

\huge{\underline{\underbrace{\mathcal\color{gold}{Answer}}}}

.the characteristic of having high moral values and behavior

4 0
3 years ago
What were the Pennsylvania Germans being persecuted for?
klio [65]
There were many reasons why Germans left their homeland to make the treacherous journey across the Atlantic to America. Although much has been said about religious persecution, dissenters compromised a minority of German immigrants to Pennsylvania. Most were affiliated with Lutheran and Reformed churches, conservative religious groups.
6 0
2 years ago
In her Infinity Rooms, Kusama places mirrors on the walls and ceilings. This creates an endless ___________ of space.
3241004551 [841]

Answer:

Illusion

Explanation:

6 0
3 years ago
Read 2 more answers
I NEED ANSWERS
Sindrei [870]

Answer:

MIND BLOWING QUESTIONS NO IDEA

Explanation:

Even scientict don't know

6 0
3 years ago
Other questions:
  • In sculpture in the round, the division of positive and negative space is dependent on the _______________________
    11·2 answers
  • How has the piano impacted society in a positive way?
    7·1 answer
  • HOLAAA! COMO ESTAN ME PUEDEN AYUDAR CON MI TAREA.?? GRACIASS SALUDOS!
    10·1 answer
  • Diferencias y similitudes en la película lazarillo de tormes y la novela lazarillo de tormes
    11·1 answer
  • Allegories and fables are both types of __________.
    11·2 answers
  • Help me please! It’s not hard I’m just really stupid
    10·2 answers
  • I need help.
    10·2 answers
  • Please help, Im confused about this one.
    12·2 answers
  • Nicolas Poussin outlined the principles of classicism and described the essential ingredients necessary to produce a painting th
    15·1 answer
  • I am bord ... :P<br> XD u will git it sometime
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!