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
neonofarm [45]
2 years ago
9

What is the output of the following Python statements? def recurse(a): if (a == 0): print(a) else: recurse(a) recurse(0)

Computers and Technology
1 answer:
FrozenT [24]2 years ago
5 0

Answer:

d) 0 1 1 2

The above piece of code prints the Fibonacci series.

Explanation:

def a(n):

   if n == 0:

       return 0

   elif n == 1:

       return 1

   else:

       return a(n-1)+a(n-2)

for i in range(0,4):

   print(a(i),end=" ")

You might be interested in
Which option in a Task element within Outlook indicates that the task is scheduled and will be completed on a later
joja [24]
I think it’s in progress
5 0
2 years ago
Read 2 more answers
Which is a feature of audio editing software?
riadik2000 [5.3K]
D. It is used to add sound effects.
Hope this helps!
5 0
3 years ago
Read 2 more answers
Create a function called makePositive that accepts a single argument: an integer array. The function should walk through the arr
coldgirl [10]

Answer:

This solution is implemented in C++

void makePositive(int arr[]){

   int i =0;

   while(arr[i]!=0){

       if(arr[i]<0){

           arr[i] = abs(arr[i]);

       }

       i++;

   }

   i = 0;

   while(arr[i]!=0){

    cout<<arr[i]<<" ";

    i++;

}  

}

Explanation:

This defines the function makePositive

void makePositive(int arr[]){

This declares and initializes i to 0

   int i =0;

The following iteration is repeated until the last element in the array

   while(arr[i]!=0){

This checks if current array element is negative

       if(arr[i]<0){

If yes, it changes it to positive

           arr[i] = abs(arr[i]);

       }

The next element is then selected

       i++;

   }

This sets i to 0

   i = 0;

The following iteration prints the updated content of the array

<em>    while(arr[i]!=0){ </em>

<em>     cout<<arr[i]<<" "; </em>

<em>     i++; </em>

<em> }   </em>

}

See attachment for full program which includes the main

Download cpp
8 0
2 years ago
Who sang devil went down to georgia
katrin2010 [14]

Answer:

Charlie Daniels sang that one for sure

4 0
3 years ago
Output the following 21%4​
Vadim26 [7]
21%4 is 1.

21-4=17
17-4=13
13-4=9
9-4=5
5-4=1
4 0
3 years ago
Other questions:
  • What item on a business card is generally the most prominent?
    13·2 answers
  • Select all examples of proper keyboarding technique.
    15·2 answers
  • Someone who is young, lacks funds, and really wants to gain technical skills while serving his or her nation should consider
    15·1 answer
  • A hierarchical topology is also called a _____ topology.
    9·1 answer
  • Write a regular expression that selects lines containing any of the following words: linux windows solaris macos. For this exerc
    13·1 answer
  • How do i convert videos on the computer
    10·1 answer
  • Which of the following statements is true?A)Implicit data type conversion is performed when you mix values of different data typ
    5·1 answer
  • Adding Page Numbers in the Footer
    15·1 answer
  • A search for reliable information is a search for what?
    14·1 answer
  • Write a pseudocode that receives a positive number from the user, and then,
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!