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​ _______ helps us understand the nature of the distribution of a data set.
Sphinxa [80]

Frequency distribution
3 0
3 years ago
Given the availability of an ifstream object named input, write the other statements necessary to read an integer into a variabl
tatiyna

Answer:

input.open("rawdata");

input>>datum;

input.close();

Explanation:

ifstream objects maintain a filebuf object as their internal stream buffer, and perform operations like input/output on the available associated files.

In above statements.

                            input.open("rawdata");

  • The associated file named rawdata is opened.

                            input>>datum;

  • The integer from the file is read into already declared variable datum.

                             input.close();

  • Input stream is closed.
4 0
2 years ago
1.
Vlad1618 [11]
A. Since it tells about how people think she’s lesser because she’s a women.
7 0
2 years ago
What does "ttyt" stand for?
EastWind [94]
TTYT stands for "talk to you tomorrow".
6 0
3 years ago
Read 2 more answers
TRUE OR FALSE!!!!!
KatRina [158]

Answer:

True

Explanation:

Using CCleaner, it's revealed that there are trackers within "secure" websites/apps such as Google and Tiktok. The manufacturer(s) of these websites/apps can share your information with whoever they're working with. Since people often look past the terms and conditions when installing an app and or program, they don't see that companies can easily retrieve all of your data within a couple clicks.

6 0
3 years ago
Other questions:
  • ​_______ consists of the analysis​ tools, technologies, and processes by which marketers dig out meaningful patterns in big data
    7·1 answer
  • A 2-dimensional 3x3 array of ints, has been created and assigned to tictactoe. Write an expression whose value is true if the el
    10·1 answer
  • "The effectiveness of memory retrieval is directly related to the similarity of cues present when the memory was encoded to the
    11·1 answer
  • Heelp my brainly stuff says i am 49 but im 11 how to fix?X??
    7·1 answer
  • Which of the following statements is true?
    9·1 answer
  • Please its argent and I will give you BRAINLIEST ANSWER 6. How would you confirm that a colourless liquid given to you is pure w
    10·1 answer
  • I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right b
    14·1 answer
  • Question 8 (True/False Worth 3 points)
    15·1 answer
  • The success criteria are used to judge whether a project is successful. False True <br> need it now
    13·2 answers
  • What is professional education? <br><br><br><br><br>Please help me to do this.​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!