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 some of the legal and ethical obligations Andrew Maynard Architects may have considered when designing the Hill House
gtnhenbr [62]

Answer:

Australian architect Andrew Maynard had to rethink the organisation of spaces in a home to the north of Melbourne. The family that commissioned the renovation project had already added extensions onto the home, building an additional level that blocked out the daylight for a number of parts of the house and the garden. The problem was that the land in the neighbourhood had been divided up into very small lots, and the family's three children made this final renovation necessary.

7 0
2 years ago
Which term is used to describe the cubist viewpoint where a subject is shown from all sides at once?
julia-pushkina [17]

Answer:

multiple perspective, simultaneity or multiplicity

Explanation:

yes

5 0
2 years ago
Read 2 more answers
1. Eventually, the use of significantly advanced animation and digital effects in film.
Evgesh-ka [11]
I think it’s computers hope this helps
5 0
2 years ago
Off-topic meme just for fun 50 points this is to help people for points PART 2<br> "Creeper-
Alexus [3.1K]
Awwwwwwwwww maaaaan
4 0
3 years ago
Read 2 more answers
Take a moment to analyze this work:
qaws [65]

Answer:

D. Dominance

Explanation:

The bowl of apples dominates the painting.

5 0
3 years ago
Other questions:
  • Which gospel artist recorded the song "move on up a little higher"?
    7·2 answers
  • Joel is editing a picture for an advertising assignment. Which technique should he use if he wants to make part of the picture s
    11·2 answers
  • If you can in your spare time go like and share these videos by MDTV.
    13·2 answers
  • For whoever wants to join a zo-om
    15·2 answers
  • Hi brendan how are you
    11·1 answer
  • What WLW should I draw next for art class? SEND AN IMAGE REFERENCE
    5·1 answer
  • Along elemento ng linya Ang nagpapakita NG lakas​
    11·2 answers
  • 3. Which key has 5 flats?​
    9·2 answers
  • Does anyone wanna go out with me
    11·2 answers
  • How would I make a bedroom theme about parkour?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!