Challenge: Loop It, Then Launch It!
In this challenge, you’ll practice using two different loops to control how your program runs.
Your task
Use a
forloop to print the numbers 1 through 10, one number per line.Use a
whileloop to create a countdown starting from 3.After the countdown finishes, print "Go!".
What to think about
A
forloop is best when you know exactly how many times to repeat.A
whileloop keeps running as long as a condition is true.Make sure your countdown number changes each time, or the loop won’t stop.
Challenge: Loop It, Then Launch It!
In this challenge, you’ll practice using two different loops to control how your program runs.
Your task
Use a
forloop to print the numbers 1 through 10, one number per line.Use a
whileloop to create a countdown starting from 3.After the countdown finishes, print "Go!".
What to think about
A
forloop is best when you know exactly how many times to repeat.A
whileloop keeps running as long as a condition is true.Make sure your countdown number changes each time, or the loop won’t stop.