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
Answered by Matthew M. Python tutor

4181 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

Write a function s(n) that will return a list of the first n squares.


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


how to compute the factorial of a number.


Write a basic program to output the lowest of 3 input numbers. (You may omit error checks on your inputs)


We're here to help

contact us iconContact ustelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences