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
Help please
Elanso [62]

Answer:

i would say c

Explanation:

because any art not already under copyright would be considered free to copy such as fan art

8 0
3 years ago
Read 2 more answers
Look at this painting. What system of perspective does it primarily use?
Y_Kistochka [10]

Answer: aerial perspective

Explanation:

just makes the most sense

8 0
4 years ago
Read 2 more answers
Because of the influence of islam, what happened to the painting of a persian miniature, khamseh ( the quintet) ?
Tanzania [10]

Answer:

The answer should be B or D

Explanation:

3 0
3 years ago
What is the subject, and what is one central theme in this story? How does the author introduce and develop this theme throughou
andreev551 [17]
One central theme in the story :
Strict teacher way in educating his student.

The story tells about a teacher that often use corporal punishment such as caning to teach discipline to his student.

One of the subject of the story is when a young boy is punished because rather than doing his homework himself, his father do it for him
4 0
3 years ago
What is the purpose of life?
Agata [3.3K]
To be yourself. To find out who "yourself" is. Who are you? Who do you want to be? Find your purpose. Whatever that may be. I feel that MY purpose is to write music, and help others through it, just like my hero did for me. No one else is dealing with your demons, meaning, maybe defeating them, could be the beginning of your meaning, friend.

6 0
3 years ago
Read 2 more answers
Other questions:
  • How is a piece of music written in 3/4 time different<br> from a piece of music written in 4/4 time?
    15·2 answers
  • What do beowulf's followers do when they realize he's losing? what does wiglaf do?
    9·1 answer
  • Has anyone ever fell in love and didn't tell the guy or girl? Then they leave you and you wish everyday that you told them that
    15·2 answers
  • Match each of these 19th- and 20th-century artistic movements with the value or concept that it was most closely associated with
    15·1 answer
  • What musical form was a carry over from African American singing, into what became known as the Blues?
    14·1 answer
  • The Japanese Tea Ceremony is a ritual that encourages the adherent to "leave the concerns of the daily world behind and enter a
    12·1 answer
  • In what country would u hear music accompanied by a cuatro
    9·2 answers
  • The primary light colors are red, green, and blue. true or false.
    9·2 answers
  • you have learned about the social and cultural relevance of art. pick any arties from the last 20th century and analyze one of t
    7·1 answer
  • The eiffel tower in france is an example of what kind of architectural relationship?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!