96,141 views
1 vote
1 vote
Fill in the countdownFrom method, so it prints a line with each number starting with the first number down to the second number. For example, calling countdownFrom(5, 2) will print: 5 4 3 2 You may assume that the second parameter will be no larger than the first number. Make sure your run method calls countdownFrom(10, 5)!

User AshleyWilkes
by
2.7k points

1 Answer

11 votes
11 votes

Answer:

def countdownFrom(first, second):

for i in range(first, second - 1, -1):

print(i)

countdownFrom(10, 5)

Step-by-step explanation:

since you didnt mention what program to use, im assuming you are using python

User Shubham Das
by
2.7k points