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
What issue inspired students to organize a walkout in 2018?
Kamila [148]

Answer:

Gun violence across the U.S. (problems associated with guns )

Explanation:

The National School Walkout was a national protest led by students in response to the Marjory Stoneman Douglas mass shooting on April 20, 2018.

3 0
3 years ago
Read 2 more answers
(MC)Abigail is filming a scene in which the camera focus is shifting from one actor to another. What is this type of focus calle
masha68 [24]
The correct answer is moving focus
6 0
3 years ago
Read 2 more answers
How many symphonies did "Papa" Haydn write?<br> 1<br> 9<br> 41<br> 87<br> O<br> 107
lord [1]
It should be 106 symphonies but just answer 107 symphonies.
5 0
2 years ago
Consider this painting entitled great fish-market by Bruegel
lbvjy [14]

Brueghel's Great Fish-Market, dating back from the year 1603, comprises many elements of Mannerist landscape painting. Presented in a panorama view, the picture opens up across a downward-sloping foreground overflowing with tens of people grouped around the stalls and booths of a fish market, with a beautiful blue sky in the background, that merges with the sea.

3 0
3 years ago
Read 2 more answers
In reminiscing about the making of Toy Story, the creators realized the most important thing they learned in how to use feedback
Naily [24]

Answer:

The creators Of Toy Story realized that the most important thing about the notes they recieved was on indentifying the most vital elements of this feedback

Explanation:

Since the feedback was given by the company, the vitality  was found in building the content around the most remarkable critics that the company thought wouldn't work, this meaning that they had to leave their hurt egos aside and focus on fixing everything for the bigger picture

7 0
3 years ago
Other questions:
  • Imagine you're traveling through the backwoods of North Carolina with Cecil
    14·1 answer
  • What are your thoughts on those who push through and break barriers in dance?
    5·1 answer
  • What ryhme with sport​
    12·1 answer
  • 1. Explain how Claudio has "changed". Who was he before? What kind of
    8·1 answer
  • Right-of-way is _____. A. the permission to proceed instead of another road user B. the permission to disobey a traffic control
    6·2 answers
  • What is the most common error in the lighting of high school plays?​
    12·2 answers
  • Who is depicted in the image above?
    6·2 answers
  • A photographer for the New York Evening Sun. He turned his camera on the crowded, unsafe, rat-infested, tenement buildings where
    11·1 answer
  • Please help and answer fast
    11·2 answers
  • The social information-processing theory explains how
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!