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 using range() and a list of values?


Give a segment of python code that will print the numbers 1 to 7, each one on a new line


Define a function that takes in the age of the user and adds it to an output sentence such as "You are ..... old".


Generate an array of integers from 0 to 99 and split it into two smaller arrays. Each smaller array will contain half of the original.