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 hegemonic norms of gender did the film, Micky Mouse Monopoly, bring to
lina2011 [118]

Answer:

Explanation:

Given its global reach, how the Walt Disney Company handles the role of race, gender, and s3xuality in social structural inequality merits serious

7 0
2 years ago
Bro like I'm dead <br> You killed me <br> I'm dead now
mixas84 [53]

bro im sorry i didnt mean to

6 0
3 years ago
Read 2 more answers
Which colors make purple?
laila [671]
Red and blue makes purple.
Hope I helped:)
8 0
4 years ago
Read 2 more answers
In ancient Indus sculpture, people were represented _______________.
Nutka1998 [239]
Realistically. Is the answer to ur question
3 0
3 years ago
The Gothic style originated sometime between 1937 and 1944 in the province Ile-de France, an area known as the domain of Kings.
tankabanditka [31]
Completely true hope this helps :)
5 0
3 years ago
Other questions:
  • Why was the djembe used?
    11·1 answer
  • Name the three elements that blend to make early Medieval art.
    8·1 answer
  • Which of the following is an example of a boy band?
    6·2 answers
  • What exactly is reader's theater?
    7·1 answer
  • Enque consiste ejercer la ciudadanía
    13·2 answers
  • The Motion Picture Projector relies on which concepts to function? (Select 5
    8·1 answer
  • Narration that presents all elements of the plot, exceeding the perspective of any one character is called:_____
    7·1 answer
  • What significant move did Donatello’s David make for Renaissance artwork?
    6·2 answers
  • You have been hired as a tour guide for the Great Sphinx of Giza. To prepare for this job, you have learned facts to tell visito
    7·1 answer
  • Which is NOT an Islamic calligraphy style?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!