1.6 How to use for loops

Topic

1.6 How to use for loops

Topic Progress:

In the first challenge, you needed to draw a square using a turtle. When you have repeated actions we can you a for loop to repeat actions a certain amount of times.

A for loop should look similar to this:

for i in range(4):
    #some code

If you want to change the number of times the loop runs to change the number 4 to a variable like the code below:

repeatCount = 5
for i in range(repeatCount):
    #some code

Try get the turtle to make various shapes such as a square using a for loop rather than repeating the command

@

Not recently active