Implement a rocket launch countdown.

To do this we would create a function with a simple loop that iterates downwards and prints the numbers downwards. Then at the end of the loop we would simply print 'blast off'.def countdown (n): while n > 0: print (n) n = n - 1 print ("blast off")

MM

Related Python Mentoring answers

All answers ▸

What is the difference between a cycle "if" and "while"?


What is the difference between using range() and a list of values?


Manually implement a function that finds the smallest value in a list of integers and print it.


Write a short program to print all the even numbers 1 to 100