Question: def counter ( start , stop ) : if start > stop: return _ string = Counting down: while _ _ _ # Complete

def counter(start, stop):
if start > stop:
return_string = "Counting down: "
while ___ # Complete the while loop
___ # Add the numbers to the "return_string"
if start > stop:
return_string +=","
___ # Increment the appropriate variable
else:
return_string = "Counting up: "
while ___ # Complete the while loop
___ # Add the numbers to the "return_string"
if start < stop:
return_string +=","
___ # Increment the appropriate variable
return return_string
print(counter(1,10)) # Should be "Counting up: 1,2,3,4,5,6,7,8,9,10"
print(counter(2,1)) # Should be "Counting down: 2,1"
print(counter(5,5)) # Should be "Counting up: 5"

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!