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
Look at the two types of syllogisms in Lesson 7. Give an original example of each type. Explain why each example is valid or inv
bulgar [2K]

Answer:

valid means it good and invalid means bad

4 0
3 years ago
Why does Atlas beg Perseus to show him medusas head
borishaifa [10]

Atlas is tried of holding up the heavens.

6 0
4 years ago
What made the instrument unique from spain​
weeeeeb [17]

Answer:

<h3>Castanets</h3>

•Have you ever watched Flamenco dancers at a Spanish or tapas restaurant and wondered about the little percussion instruments in their hands? These are called castanets.

•Castanets are popular handheld instruments that have been used in Mediterranean music styles for centuries.

They’re used in just about every music style globally, but they gained popularity in regions such as Greece, Turkey, and Italy.

Eventually, they made their way to Spain. Today, they’re Spain’s national instrument.

Most people will recognize the traditional flamenco castanet, which looks different than other types of castanets. That’s because modern castanet was developed in Spain.

•Castanets are usually made out of castana wood, though they can also be made out of metal. The instrument consists of two cups with curved dips on one side.

These cups are manufactured in a specific way to create a unique sound. They’re drilled so one cup is a higher pitch than the other. This is why this little instrument gives off such a distinct sound.

8 0
4 years ago
The techniques of perspective talked about in the video are
jekas [21]

Answer:

Well there's no video attached but as someone who draws, i believe it is true

8 0
3 years ago
Read 2 more answers
The food service industry has evolved dramatically over time, but not everything has changed. Name something that has remained t
jenyasd209 [6]

Answer:

he food service industry has evolved dramatically over time, but not everything has ems that are usually served for breakfast, lunch, or dinner, are offered at all times ... and follow operating procedures that have been standardized for every restaurant in the chain. ... two non-competing brands are offered to consumers in the same building location.changed. Name something that has remained the same.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • The focal point of robert rauschenberg's sculpture monogram is:
    13·1 answer
  • What does 57% of Federal discretionary spending pay for
    12·1 answer
  • Which region is famous for its totem poles?
    14·2 answers
  • To all the guys out there read my username
    6·2 answers
  • Orchestration is the combination of a conductors musical ideas with the composers musical ideas true or false
    10·1 answer
  • How to write gratitude for teachers
    8·1 answer
  • In 3-4 complete sentences define the following terms medium , political power
    8·1 answer
  • PLZ HELP I'LL PICK BRAINLIEST
    13·1 answer
  • How did Martin Luther King Jr. view the state of the nation when he was writing this letter? Refer to the second paragraph to su
    7·1 answer
  • What is 1 millionx10
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!