Python | Ranges and loops exercise | Count down from 10 to 1 so your rocket can blast off
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
The aim of this exercise is to count down as follows:
Your program should count down from 10 to 1.
Create a program called Ignition sequence.py. Within this create a loop which goes from 10 down to 1. The syntax of the range function is as follows:
How to write a range function loop.
Within the loop, your program should print out the countdown number. Here's a hint to show you how you could use the format function to display your results:
This program would print out a neatly formatted message.
Finish your program with a blast-off message, test it and close it down.