Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
720 B
204
Indexable
Never
import turtle
turtle.color('green', 'black')
turtle.shape('turtle')
turtle.shapesize(2)
turtle.speed(100)

def square(edge: float):
    for step in 1, 2, 3, 4:
        turtle.forward(edge)
        turtle.left(90)

def star(edge: float):
    for step in range(5):
        turtle.forward(edge)
        turtle.right(2 * 360 / 5)

def face():
    square(80)
    turtle.forward(20)
    turtle.begin_fill()
    square(40)
    turtle.end_fill()
    turtle.forward(100)
    square(80)
    turtle.forward(20)
    turtle.begin_fill()
    square(40)
    turtle.end_fill()
    turtle.penup()
    turtle.forward(80)
    turtle.left(90)
    turtle.backward(120)
    turtle.pendown()
    square(240)
    turtle.hideturtle()

star(200)