π’ Day 1
December 07, 2016Do Now (in Classroom)
What are the smallest and biggest numbers that will print?
for x in range(42):
print (x + 1)
π’ Turtle Python
A module that we are going to use to extend Python, allowing us to make graphics.
Commands
Commands | Example: | What this does β |
---|---|---|
Naming | leonardo = turtle.Turtle() |
Names the turtle leonardo |
Change shape | leonardo.shape(βturtleβ) |
Makes a turtle appear instead of a triangle Available shapes are βarrowβ, βturtleβ, βcircleβ, βsquareβ, βtriangleβ, βclassicβ |
Movement (pixels) | leonardo.forward(75) , leonardo.backward(75) |
Moves forward 75 pixels, Moves backwards 75 pixels |
Turning (degrees) | leonardo.right(70) , leonardo.left(70) |
Turns right 70 degrees, Turns left 70 degrees |
Color (string) | leonardo.color('red') |
Changes the turtle and drawing color. Click here for more colors. |
β¦and many more.
Practice (in repl)
Click here to access π’ Python Turtle Practice
β
Change turtle name
β
Set pen size to 5
β
Set turtle speed to 0
β
Change pen color to a color you like
β
Give the turtle a shape
β
Draw a square
β
Draw a square using a loop
β
Draw a square using a loop and stamp each corner