Question: Write a function countdown(n), which in 1- second intervals outputs n messages of the form n seconds to go, n-1 seconds to go 2 seconds

 Write a function countdown(n), which in 1- second intervals outputs n

Write a function countdown(n), which in 1- second intervals outputs n messages of the form "n seconds to go", "n-1 seconds to go" "2 seconds to go", "1 second to go", and then returns the string "Countdown finished." Your program must ensure that the countdown cannot be interrupted by pressing Ctrl-0C Hint: The time module and the continue command could be useful

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!