Ask coding questions

← Back to all posts
This is the code that's clocking in replit. It runs in 3 seconds on runestone. What's happening
ewdillard1

U5L5 - For Loops

Date: 10/06/2021

Demo of a for loop

import turtle
wn = turtle.Screen() # Set up the window and its attributes
wn.bgcolor("lightgreen") # Define variable for WN

tess = turtle.Turtle() # create tess and set his pen width
tess.pensize(5) # Defined variable for tess
tess.color("blue")

distance = 50 # Define an attribute(variable) distance

for _ in range(10): #Indicate that this loop should run 10 times.
tess.forward(distance) #Forward
tess.right(90) #turn 90 degrees
distance = distance + 10 #Increase distance variable by 10

Voters
ewdillard1
Comments
hotnewtop
ewdillard1

I get a symbol that indicates the program is working - but it doesn't run.
When I cut and paste -the indenting didn't come across well - it's there.

SixBeeps

What do you mean by 'clocking'?