4 Turtles Flashcards
1
Q
Get turtle module
A
import turtle
2
Q
Get canvas
A
wn = turtle.Screen()
3
Q
Make turtle
A
alex = turtle.Turtle()
4
Q
Move ahead
A
alex.forward(100)
5
Q
Turn
A
alex.left(90)
6
Q
Using alex.forward() or alex.left()
A
Invoke methods of alex
7
Q
Invoke method of alex
A
Use alex.forward() or alex.left()
8
Q
Change canvas color
A
wn.bgcolor(“blue”)
9
Q
Change pen color
A
alex.color(“blue”)
10
Q
Change pen size
A
alex.pensize(3)
11
Q
Close canvas
A
wn.exitonclick()
12
Q
Loop var in for x in y:
A
x
13
Q
Lift pen
A
alex.up()
14
Q
Change shape
A
alex.shape(“turtle”)
15
Q
Change speed
A
alex.speed(3)