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
Match the definition with the corresponding word
Oksana_A [137]

Answer:

Ram is your memory

that's all i know

4 0
4 years ago
Read 2 more answers
Brian is selecting an authentication protocol for a PPP connection. He would like to select an option that encrypts both usernam
aleksklad [387]

Answer:

CHAP

Explanation:

CHAP or Challenge-Handshake Authentication Protocol is the best option for Brian´s PPP connection. CHAP allows to validate the identity of users by using the three-way handshake at the first time of the connection and again at any moment after establishing the initial communication.

8 0
3 years ago
The following function open_file() opens a file called 'example.txt' and returns the file pointer. This function is called withi
dsp73

Answer:

Code is given as below:

Explanation:

def open_file():

   fpointer = open('example.txt')

   return fpointer

def main():

   dictlist = []

   dict_of_words = dict()

   fp = open_file()

   # loop to iterate over lines in file

   for line in fp:

       for word in line.split():

           if(not dict_of_words.get(word)):

               dict_of_words[word] = 1

           else:

               dict_of_words[word] += 1

   for key, value in dict_of_words.items():

       temp = (key.lower(), value)

       dictlist.append(temp)

   print(sorted(dictlist))

main()

8 0
3 years ago
A group of users in a small publishing office want to share large image files in a common folder with high availability. Which o
mash [69]

Answer:

Network storage appliances

Explanation:

Because I just took a test

7 0
3 years ago
An anchor tag can be coded using which two attributes? HELP ME PLEASE!!!!
Mashcka [7]

Answer:

option 1

Explanation:

href tag:- It gives the url of the destination where the link is forwarded to. It ia clickable portion of text.

name tag:- It defines the name of anchor.

5 0
4 years ago
Read 2 more answers
Other questions:
  • A process-based DO/S must synchronize actions across the network. When a process reaches a point at which it needs service from
    6·1 answer
  • Windows 7 is used to run ____ software
    5·2 answers
  • Trish has bought a new computer that she plans to start working on after a week. Since Trish has not used computers in the past,
    10·1 answer
  • Which command would you use on a switch to enable management from a remote network?
    5·1 answer
  • A thesaurus can be used to look up a (n) or word similar in meaning to a given word
    15·1 answer
  • Which of the following are provided by most
    5·1 answer
  • This inventor made their own fortune. They had little to no help in become one of the first black millionaires. They invented a
    9·1 answer
  • Brainliest for whoever adds me on snap<br> gianavaughn007
    15·2 answers
  • Que segnifica mmmju?​
    15·1 answer
  • Match the correct answers with the statements.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!