Question: def countdown ( start ) : x = start if x > 0 : return _ string = Counting down to 0 : while

def countdown(start):
x = start
if x >0:
return_string = "Counting down to 0: "
while ___ # Complete the while loop
___ # Add the numbers to the "return_string"
if x >0:
return_string +=","
___ # Decrement the appropriate variable
else:
return_string = "Cannot count down to 0"
return return_string
print(countdown(10)) # Should be "Counting down to 0: 10,9,8,7,6,5,4,3,2,1,0"
print(countdown(2)) # Should be "Counting down to 0: 2,1,0"
print(countdown(0)) # Should be "Cannot count down to 0"

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!