Codes for drawing smiley face in python
Before you read section
# you can follow us by Clicking here
Draw smiling face emoji using Turtle in Python
Prerequisite: Python Turtle Basics
Turtle is an inbuilt module in Python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle. To move turtle, there are some functions i.e forward(), backward(), etc.
In this article, we will see how to draw a smiling face emoji using the Turtle module.
1.)To draw Smile face :
Following steps are used :
Import turtle.
Make objects.
Draw a circle and fill yellow color.
Draw eyes with two circles and fill white and black color respectively.
Draw circle for nose and fill black color.
Draw semi circle for mouth.
Draw semi circle for tongue and fill red color.
Below is the implementation :
# Python program to draw smile
# face emoji using turtle
import turtle
# turtle object
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(100)
pen.end_fill()
pen.up()
# draw eyes
pen.goto(-40, 120)
eye('white', 15)
pen.goto(-37, 125)
eye('black', 5)
pen.goto(40, 120)
eye('white', 15)
pen.goto(40, 125)
eye('black', 5)
# draw nose
pen.goto(0, 75)
eye('black', 8)
# draw mouth
pen.goto(-40, 85)
pen.down()
pen.right(90)
pen.circle(40, 180)
pen.up()
# draw tongue
pen.goto(-10, 45)
pen.down()
pen.right(180)
pen.fillcolor('red')
pen.begin_fill()
pen.circle(10, 180)
pen.end_fill()
pen.hideturtle()
______________________________________________
After reading section
Thanks for viewing this .
If you like this then follow us and share this with your family and friends .......
______________________________________________
Blog Details
•Blog Owner:- @Dashing_Shivansh
•Blog url:- Click here
•Insta ID:- @dashing_shiv.ansh
•insta url:- Click here
Great work
ReplyDelete