import turtle as t
t.shape("turtle") # “arrow”, “turtle”, “circle”, “square”, “triangle”, “classic”
t.color("red")
t.pensize(width=5)
t.begin_fill()
#
t.forward(50)
t.right(90)
t.forward(50)
t.right(90)
t.forward(50)
t.right(90)
t.forward(50)
t.right(90)
t.end_fill()
t.exitonclick()
import turtle as t: This means t will mean turtle from now.
t.shape("turtle"): This code programs the shape of the turtle. The shape could be turtle, arrow, circle, square, triangle, classic.
t.color("red"): This code decides the color of the turtle.
t.pensize(width=5): This code changes the thickness of the pen tool.
t.begin_fill(): This code tells what the turtle must draw.
t.forward(50): This makes the turtle move forward 50 cubits.
t.right(90): Makes the turltle turn right 90 degrees.
t.forward(50)
t.right(90)
t.forward(50)
t.right(90)
t.forward(50)
t.right(90): These are a repition of going forward 50 cubits and turning 90 degrees.
t.end_fill(): This code fills the color inside the cube.
t.exitonclick(): This code makes it that if you click the turtle screen it will exit the window.
Finally, what shape you draw?
A square