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 is the roles that lead music editor
fiasKO [112]
Music editors help directors achieve their musical ambitions on films, and provide a crucial link between the film and composer
8 0
3 years ago
In which art genre did we first see characters such as Superman, Batman, and Spiderman?
marishachu [46]
A) comic books..... hope it helps :)
6 0
3 years ago
Read 2 more answers
Who is phillip glass
KiRa [710]

Answer: Philip Glass (born January 31, 1937)[1] is an American composer and pianist. He is widely regarded as one of the most influential composers of the late 20th century.[2][3][4] Glass's work has been described as minimal music, having similar qualities to other "minimalist" composers such as La Monte Young, Steve Reich, and Terry Riley.[5] Glass describes himself as a composer of "music with repetitive structures",[6] which he has helped evolve stylistically.[7][8]

Glass founded the Philip Glass Ensemble, with which he still performs on keyboards. He has written numerous operas and musical theatre works, twelve symphonies, eleven concertos, eight string quartets and various other chamber music, and film scores. Three of his film scores have been nominated for Academy Awards.

4 0
3 years ago
Read 2 more answers
Please answer the question. <br> I have from every one to answer the question.
larisa [96]

1) Fixed mindset

2) Growth mindset

3) Fixed mindset

4) Growth mindset

5) Fixed mindset

6) Fixed mindset

7) Fixed mindset

8) I'm not completely sure on this one, I believe it's a fixed mindset.

5 0
3 years ago
Read 2 more answers
Music based on the seven tones of a major or minor scale is called:
Svetradugi [14.3K]
It is called a Diatonic .. hope this helps :)
3 0
3 years ago
Other questions:
  • How did beetover have a influance on the romantic period?
    13·1 answer
  • Which of the followings is not a true statement ?
    8·2 answers
  • Are all world instruments stringed instruments <br><br> true <br><br> or<br><br> false
    13·2 answers
  • Identify what are instruments during the medieval period renaissance and baroque period?
    5·1 answer
  • A common social issue Loraine Hansberry wrote about in A Raisin in the Sun centered around which group of people:
    12·2 answers
  • How to critique this a photograph I need a paragraph please I need help
    8·1 answer
  • Whoever can say the most kind thing about a fast food place gets brainliest!
    10·2 answers
  • What is Exposure?
    13·2 answers
  • Can somebody make me an edit? I need a new wallpaper..
    15·2 answers
  • Which of these can spread a pathogen?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!