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
Listen to this piece of music
Sloan [31]

Answer:

it is A

Explanation:

8 0
3 years ago
Read 2 more answers
Name and define 3 elements of music. Give at least 2 examples of each. in ur own words.
AleksandrR [38]

Dynamics

  • Example — forte, piano

Rhythm

  • Example — beat, meter

Harmony

  • Example — chord, progression
8 0
2 years ago
Would you believe in a liar who admits he is one?
Vilka [71]
Yes because he cant lie about that 

5 0
3 years ago
Read 2 more answers
Choose the words to fill in the blank, which best complete the sentence.
Hitman42 [59]

Answer: d. (1) values; (2) depth

3 0
3 years ago
Billy Preston was an innovator in gospel music on what instrument
jenyasd209 [6]

Answer:

He played on a keyboard for the rolling stones. Hope this helps :)

5 0
3 years ago
Read 2 more answers
Other questions:
  • Credited with being the founder of Renaissance painting in the Netherlands
    6·1 answer
  • As tempo speeds up, there will be more beats per measure true or false
    13·1 answer
  • The colossal head monuments have managed to survive thousands of years, however have been faced with various circumstances that
    5·2 answers
  • All right people this is the last question for a while i am losing this laptop because it is the schools but once i get a phone
    13·2 answers
  • The following question refers to The Bells by Edgar Allan Poe. Which of the following is an example of onomatopoeia relating to
    8·1 answer
  • To a certain extent, all works of art share five basic qualities: (1) they are created by humans, (2) they create consensus, (3)
    6·1 answer
  • Are the words andante, ritardando, allegro, fine, and con brio used to describe a musical scale?
    15·2 answers
  • If you think your having a bad day listen to hurt by Johnny Cash If you think your life's terrible listen to Wrong side of heave
    11·2 answers
  • Tell me the Rhythm And Beats <br> EX:one two and three and four
    6·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!