Python turtle Flashcards
to know the commands for my python turtle test.
Whats the first command you type when doing turtle?
import turtle
How do you set up the window?
wn=turtle.Screen( )
remember the capital S and the brackets
How do set the background colour?
wn.bgcolor(“green”)
How do you give the window a title?
wn.title (“ TITLE INSERT HERE “)
How would you create a turtle named Tim?
Tim=turtle.Turtle( )
How would you create a turtle named Tess?
Tess=turtle.Turtle( )
How can i make tess Green?
tess.color (“green”)
How can i change the size of Tess?
tess.pensize(“ eg 20”)
How do i make tess a turtle?
tess.shape(“turtle”)
how can i move tess forward?
tess.forward( 100)
how can i move tess right/left
tess.right/left (360/number of sides of shape)
whats the command to make a loop of movements?
for myMoves in range ( ):
put number of times to repeat in the bracket.
how can you get the program to ask how many sides you want a shape to have?
numsides = int(input("How many sides would you like your shape to have (3-20)? ")) shape_name = "shape with many sides" if numsides == 3: shape_name = "triangle" if numsides == 4: