Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- screen = turtle.Screen()
- t = turtle.Turtle()
- screen.setup(500,500)
- t.width(1)
- t.speed(1)
- # Set screen color
- screen.bgcolor('teal')
- # Draw the face
- t.penup()
- t.goto(0, -100)
- t.fillcolor('yellow')
- t.begin_fill()
- t.pendown()
- t.circle(100)
- t.penup()
- t.end_fill()
- # draw the left eye
- t.goto(-30, -20)
- t.fillcolor('white')
- t.begin_fill()
- t.pendown()
- t.circle(30)
- t.penup()
- t.end_fill()
- t.goto(-30, -10)
- t.fillcolor('black')
- t.begin_fill()
- t.pendown()
- t.circle(10)
- t.penup()
- t.end_fill()
- # draw the right eye
- t.goto(30, -20)
- t.fillcolor('white')
- t.begin_fill()
- t.pendown()
- t.circle(30)
- t.penup()
- t.end_fill()
- t.goto(30, -10)
- t.fillcolor('black')
- t.begin_fill()
- t.pendown()
- t.circle(10)
- t.penup()
- t.end_fill()
- # smile
- t.goto(-55,-40)
- t.pendown()
- t.right(45)
- t.circle(80,90)
- t.penup()
- #draw a hat
- t.goto(-40,90)
- t.right(45) #set the direction forward
- t.fillcolor('red')
- t.begin_fill()
- t.pendown()
- #draw triangle
- t.forward(80)
- t.left(120)
- t.forward(80)
- t.left(120)
- t.forward(80)
- t.left(120)
- t.end_fill()
- t.penup()
- t.hideturtle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement