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
Live footage refers to:
QveST [7]

Answer:

D

Explanation:

live refers to happening right now and footage refers to videos taken and captured.

8 0
1 year ago
Need the answer ASAP plz !!!!!
Evgesh-ka [11]
Performance would be the answer
3 0
3 years ago
Write code which takes a sentence as an input from the user and then prints the length of the first word in that sentence.
Afina-wow [57]

import java.util.Scanner;

public class U2_L3_Activity_Four {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a sentence.");

       String sent = scan.nextLine();

       int count = 0;

       for (int i = 0; i < sent.length(); i++){

           char c = sent.charAt(i);

           if (c != ' '){

               count++;

       }

           else{

               break;

           }

       

   }

       System.out.println("The first word is " + count +" letters long");

   

   }

}

We check to see when the first space occurs in our string and we add one to our count variable for every letter before that. I hope this helps!

7 0
2 years ago
A student who used a regression model that included indicator variables was upset when receiving only the following output on th
jeka57 [31]

Answer:

This is a multicolinearity problem and the student should determine the variable(s) that cause(s) the problem and remove it.

Explanation:

This information means that there exists a linear combination between the independent variables. The problem might have developed due to multicolinearity producing almost perfectly linearly dependent columns.

This could also be as a results of single matrix created when the student use an incorrect indicator variables and included an additional indicator column which created linearly dependent columns.

4 0
3 years ago
Which symbol should you use for entering a formula in a cell?
Sonbull [250]

A symbol which should be used for entering a formula in a cell is: B. =.

<h3>What is Microsoft Excel?</h3>

Microsoft Excel can be defined as a software application that is designed and developed by Microsoft Inc., for analyzing and displaying spreadsheet documents by using rows and columns in a tabulated format.

<h3>What is a spreadsheet?</h3>

In Computer technology, a spreadsheet can be defined as a document which comprises cells that are arranged in a tabulated format with rows and columns. Also, a spreadsheet is typically used in various field to do the following on a data:

  • Sort
  • Calculate
  • Format
  • Arrange

As a general rule, "B. =" is a symbol which should be used for entering a formula in a cell on a spreadsheet application such as Microsoft Excel.

Read more on spreadsheets here: brainly.com/question/4965119

#SPJ1

3 0
1 year ago
Other questions:
  • What lie does E.D. tell to keep the musical from being canceled? There is a television crew coming to do a story on it. Jake wil
    6·1 answer
  • for which is a chart legend used? a.all of the time b.whenever you are comparing data that is the same c.whenever you are compar
    9·2 answers
  • If you have a long title for a table and need it to span several cells, you can use A. Merge Cells. B. Split Cells. C. Insert Co
    5·1 answer
  • If the physical memory size is doubled without changing any of its other parameters, the number of entries in the page table
    5·1 answer
  • A binary message consisting of four bits was sent to you by a friend. The message was supposed to be ABAB. Unfortunately, your f
    8·1 answer
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • ______ is a type of computer software that is installed into devices such as printers, print servers, and various types of commu
    5·1 answer
  • Why are mobile apps often easier to develop than desktop apps?
    11·1 answer
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
  • PLEASE HELP! I accidently looked up a link, and now this same link keeps popping up everywhere, how do I stop this!?!? please he
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!