Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- turtle.shape('turtle')
- turtle.speed('fastest')
- def circle_lf(x, y, rgb): # Draw a color circle. (x, y) - parameters set the length of the perimeter of the circle. (rgb) - circle color.
- turtle.begin_fill()
- for i in range(360):
- turtle.left(y)
- turtle.forward(x)
- turtle.color(rgb)
- turtle.end_fill()
- turtle.color('black')
- def arc_rg(x, y, rgb): # Draw a color arc. (x, y) - parameters set the length of the arc. (rgb) - arc color.
- turtle.color(rgb)
- for i in range(180):
- turtle.right(y)
- turtle.forward(x)
- turtle.color('black')
- # Draw a smile face
- circle_lf(1.5, 1, 'yellow')
- # Draw a smile left eye
- turtle.penup()
- turtle.left(90)
- turtle.forward(120)
- turtle.left(90)
- turtle.forward(25)
- turtle.right(90)
- turtle.pendown()
- circle_lf(0.25, 1, 'blue')
- # Draw a smile right eye
- turtle.penup()
- turtle.right(90)
- turtle.forward(50)
- turtle.right(90)
- turtle.pendown()
- circle_lf(0.25, 1, 'blue')
- # Draw a smile nose
- turtle.penup()
- turtle.right(90)
- turtle.forward(25)
- turtle.left(90)
- turtle.forward(25)
- turtle.pendown()
- turtle.width(8)
- turtle.forward(25)
- # Draw a smile mouth
- turtle.penup()
- turtle.forward(20)
- turtle.left(90)
- turtle.forward(40)
- turtle.right(90)
- turtle.pendown()
- turtle.width(8)
- arc_rg(0.7, 1, 'red')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement