CoDE: TT05
What is the difference between this square and the squares you made before? Try it out!
import turtle
turtle.begin_fill()
for i in range (4):
turtle.forward(50)
turtle.right(90)
turtle.end_fill()
import turtle
turtle.begin_fill()
for i in range (4):
turtle.forward(50)
turtle.right(90)
turtle.end_fill()
Colors (Colours)
Note that we use the American, colors here, the main colors are:
red, orange, yellow, green, blue, purple, pink, brown, gray, black and white.
There are even more colors available at: https://trinket.io/docs/colors
Try adding turtle.color("red") to your code above. What does it do? Can you make a square in your favourite colour?
red, orange, yellow, green, blue, purple, pink, brown, gray, black and white.
There are even more colors available at: https://trinket.io/docs/colors
Try adding turtle.color("red") to your code above. What does it do? Can you make a square in your favourite colour?
color swatch
New Commands to play with
penup & pendown
Here are some of the useful commands in the program above:
turtle.penup()
This takes the Turtle pen up so that it does not draw. Try removing it from the program above and see what happens. There is also turtle.pendown()
goto
turtle.goto(-300,150)
The goto command sends the turtle directly to a certain place on the screen. Just like Scratch 0,0 is the middle of the screen. The difference is that different windows have different sizes.
Lists
colors = ["red","orange","yellow","green","blue","purple","pink","brown","gray","black","white"]
It is nice to know that you can make inventories for RPG games, shopping lists and lists of colors. You can find out more about lists in this tutorial. Try changing some of the colors to see what happens you can use the Swatch here.
Here are some of the useful commands in the program above:
turtle.penup()
This takes the Turtle pen up so that it does not draw. Try removing it from the program above and see what happens. There is also turtle.pendown()
goto
turtle.goto(-300,150)
The goto command sends the turtle directly to a certain place on the screen. Just like Scratch 0,0 is the middle of the screen. The difference is that different windows have different sizes.
Lists
colors = ["red","orange","yellow","green","blue","purple","pink","brown","gray","black","white"]
It is nice to know that you can make inventories for RPG games, shopping lists and lists of colors. You can find out more about lists in this tutorial. Try changing some of the colors to see what happens you can use the Swatch here.