Question: Use python, please help below questions. Question 1 1 pts Write a function countdown_loop() that prints numbers counting down from a number n to 0

Use python, please help below questions.

Use python, please help below questions. Question 1 1 pts Write afunction countdown_loop() that prints numbers counting down from a number n to0 (or 1) without recursion. The first line has been written for

Question 1 1 pts Write a function countdown_loop() that prints numbers counting down from a number n to 0 (or 1) without recursion. The first line has been written for you. Use four spaces to indent. def countdown_loop(n): Question 2 1 pts Write a function countdown_recur() that prints numbers counting down from a number n to 0 (or 1) using recursion. The first line has been written for you. Use four spaces to indent. def countdown_recur(n): Question 3 3 pts Write a program that compares the run time of your two countdown functions, counting down from 992. Get a start time, run the same countdown function 10 times, and get an end time. Print out the time difference. A possible output might look like: Run time of loop from 992: 0.0123123123 Run time of recursion from 992: 0.0135135135

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!