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 DFS and BFS? Where can I apply each?


Write a simple Python program that asks a user to input their age and name and then return the text: "Hi my name is *NAME*, and I am *AGE* years old."


Write a function that checks whether a number is prime or not.


What are recursive functions and when should they be used?