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
Marrrta [24]
3 years ago
10

17.8.1: Writing a recursive math function. Write code to complete raise_to_power(). Note: This example is for practicing recursi

on; a non-recursive function, or using the built-in function math.pow(), would be more common.
Computers and Technology
1 answer:
Yuliya22 [10]3 years ago
6 0

Answer:

The recursion function is as follows:

def raise_to_power(num, power):

if power == 0:

 return 1

elif power == 1:

 return num

else:

 return (num*raise_to_power(num, power-1))

Explanation:

This defines the function

def raise_to_power(num, power):

If power is 0, this returns 1

if power == 0:

 return 1

If power is 1, this returns num

elif power == 1:

 return num

If otherwise, it calculates the power recursively

else:

 return (num*raise_to_power(num, power-1))

You might be interested in
A user called to inform you that the laptop she purchased yesterday is malfunctioning and will not connect to her wireless netwo
Aloiza [94]

Answer:

B. Have the user press the appropriate function key combination to enable the wireless radio and then attempt to connect to the wireless network.

Explanation:

Every more often than not, users may experience wireless connection problems. How they respond to these issues solely depends on various factors. When a user like this has issues connecting to the network, first on the list of proper troubleshooting procedures is to check whether the wireless adapter or the function key that turns the wireless radio connection on is toggled on. Sometimes the most obvious causes are the hardest to see. The user should check this first because it will save him or her lots of troubleshooting time if the switch was simply physically disabled.

6 0
3 years ago
A(n) Answer display color uses the least electricity when compared to any other color.
Elan Coil [88]

Is there answer choices because I’m not understanding what you want me to answer

3 0
3 years ago
Write down the difference between Application Software and
Tems11 [23]
Without system software, system can not run on the other hand without application software, system always runs
5 0
3 years ago
Which of the following would you not see on a windows 10 start menu?
mixas84 [53]
Task view is the option that you would not see on a Windows 10 Start menu, whereas if you click the Windows button, you can see tiles with different applications, all of your apps in the form of tiles you can distribute according to your own taste, and power button where you can choose whether you want to shut down your computer, put it to sleep, or log out.
4 0
2 years ago
__________Is a software primarily used for creation of documents such as letters and reports
babunello [35]
Answer: word processing

hope this helps :)
8 0
2 years ago
Read 2 more answers
Other questions:
  • Which css property configures the capitalization of text?
    12·1 answer
  • Several coworkers in the sales department received an email claiming to be from you. Each message was personally addressed and c
    11·1 answer
  • Who is the owner of microsoft company​
    12·1 answer
  • Given that two int variables, total and amount, have been declared, write a sequence of statements that: initializes total to 0
    14·1 answer
  • I’m turning my Pinterest into a professional account what should be my user name please try to think of a good name and not just
    11·2 answers
  • Which of the following contributes to your active digital footprint
    12·2 answers
  • How to shutdown a computer by step by step​
    5·2 answers
  • Assume you are working for the laboratory that is developing the control system for the LISAsatellites. Your job is to develop a
    9·1 answer
  • Do you have any sprites for Friday Night Funkin?
    14·1 answer
  • Jill is configuring the AutoArchive feature in Outlook 2016. What is the default setting in relation to when AutoArchive
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!