Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 51)
51.
How can you print a countdown from 5 to 1?
countdown(5, 1)
for num in reversed(range(1, 6)): print(num)
print_countdown(5)
print(5, 4, 3, 2, 1)
Answer: Option
Explanation:
To print a countdown from 5 to 1, use a loop with reversed(range(1, 6)).
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.