import turtle turtle.forward(100) # draw base turtle.left(120) turtle.forward(100) turtle.left(120) turtle.forward(100) turtle.done()
Here is what the above code is Doing:
1. turtle.forward(100) draws the base of the triangle.
2. turtle.left(120) turns the turtle 120 degrees to the left.
3. turtle.forward(100) draws the second side of the triangle.
4. turtle.left(120) turns the turtle 120 degrees to the left.
5. turtle.forward(100) draws the third side of the triangle.
6. turtle.done() keeps the turtle graphics window open until you close it.