Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

python 3 #We\'ve written a function below called countDown(). This #function tak

ID: 3717539 • Letter: P

Question

python 3

#We've written a function below called countDown(). This #function takes an int parameter, start, and prints every #number from that start to 0. The way we've written it uses #recursion· Below that funtion, write a function that does #the exact same thing, but do not use recursion. The purpose of this exercise is for you to recognize some #example instances in which you can use recursion, and what #differences can be seen in the actual code. #Make sure to actually print 0 as the last number ! def countDown(start): #If we've reached 0 already, print 0 but do not call another copy if start

Explanation / Answer

def countDown2(start): i = start if i < 0: print(i) else: while i >= 0: print(start) i -= 1