165k views
4 votes
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 Nicoqueijo
by
4.2k points

1 Answer

1 vote

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 Chris Nash
by
3.7k points