An alternative way to loop is the for loop. The syntax is as shown in the code editor. This example means “for each number i in the range 0 - 9, print i“.



Make the loop print the numbers from 0 to 19 instead of 0 to 9.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?