skyrimmaster429 skyrimmaster429
  • 08-07-2020
  • Computers and Technology
contestada

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

Respuesta :

Keiryy492
Keiryy492 Keiryy492
  • 09-07-2020

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=" ")

Answer Link

Otras preguntas

Will give brainlist...
$111, $58. $80, $58, $212, $250. $58. $100, $117 ​
how much do i make a week if i earned 9,857.38 in 4 months 7 days? Please help!!
Did Hitler in fact try to indoctrinate the youth of Germany?
the scientific notation of 537.1 is
Occupation Education Annual Salary Bachelor's Degree Interpreter $44,700 (4 years) Master's Degree Biochemist $81,800 (6 years) Training Course Hairstylist $24,
The number of oranges harvested from Jake's yard decreased by 5% from last year to this year. Jake used the following expression to find the number of oranges h
what achievement made Andrew Jackson well known throughout the country
I WILL GIVE 20 POINTS TO THOSE WHO ANSWER THIS QUESTION RIGHT NOOOO SCAMS AND EXPLAIN WHY THAT IS THE ANSWER. Find the volume to the nearest whole number. V=___
pls help me pls I will give brainliest pls pls help pls pls help me