Turtle house
- right
- forward
- goto
import turtle
def house():
trt = turtle.getturtle()
for i in range(4):
trt.forward(50)
trt.right(90)
trt.goto(25, 25)
trt.goto(50, 0)
house()
turtle.exitonclick()
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
import turtle
def house():
trt = turtle.getturtle()
for i in range(4):
trt.forward(50)
trt.right(90)
trt.goto(25, 25)
trt.goto(50, 0)
house()
turtle.exitonclick()