Create Smile Using Python Code
import turtle
pen = turtle.Turtle()
# function for creation of eye
def eye(col, rad):
pen.down()
pen.fillcolor(col)
pen.begin_fill()
pen.circle(rad)
pen.end_fill()
pen.up()
# draw face
pen.fillcolor('yellow')
pen.begin_fill()
pen.circle(105)
pen.end_fill()
pen.up()
# draw eyes
pen.goto(-40, 115)
eye('white', 15)
pen.goto(-37, 120)
eye('black', 5)
pen.goto(40, 115)
eye('white', 15)
pen.goto(40, 120)
eye('black', 5)
#draw ears
pen.goto(-80, 155)
eye('red', 20)
pen.goto(80, 155)
eye('red', 20)
# draw nose
pen.goto(0, 75)
eye('black', 8.5)
# draw mouth
pen.goto(-40, 85)
pen.down()
pen.right(90)
pen.circle(40, 180)
pen.up()
# draw tongue
pen.goto(-13, 46)
pen.down()
pen.right(180)
pen.fillcolor('red')
pen.begin_fill()
pen.circle(13, 180)
pen.end_fill()
pen.hideturtle()
turtle.done()
0 Comments