How to Make a Laughing Emoji with a Turtle in Python #python #turtle #emoji #laughing #coding

preview_player
Показать описание
#python #turtle #emoji #laughing #coding
Рекомендации по теме
Комментарии
Автор

# 😂 Face with Tears of Joy
import turtle

# Create a turtle object
t = turtle.Turtle()

# Set the background color
turtle.bgcolor("black")

# Set the pen color and size
t.pencolor("white")
t.pensize(5)

# Draw the face
t.fillcolor("yellow")
t.begin_fill()
t.circle(100)
t.end_fill()

# Draw the left eye
t.penup()
t.goto(-40, 120)
t.pendown()
t.fillcolor("white")
t.begin_fill()
t.circle(15)
t.end_fill()
t.fillcolor("black")
t.begin_fill()
t.circle(5)
t.end_fill()

# Draw the right eye
t.penup()
t.goto(40, 120)
t.pendown()
t.fillcolor("white")
t.begin_fill()
t.circle(15)
t.end_fill()
t.fillcolor("black")
t.begin_fill()
t.circle(5)
t.end_fill()

# Draw the mouth
t.penup()
t.goto(-40, 80)
t.pendown()
t.right(90)
t.circle(40, 180)

# Draw the left tear
t.penup()
t.goto(-50, 105)
t.pendown()
t.fillcolor("blue")
t.begin_fill()
for i in range(3):
t.forward(10)
t.right(120)
for i in range(3):
t.forward(10)
t.left(120)
for i in range(3):
t.forward(10)
t.right(120)
for i in range(3):
t.forward(10)
t.left(120)
t.end_fill()

# Draw the right tear
t.penup()
t.goto(50, 105)
t.pendown()
t.fillcolor("blue")
t.begin_fill()
for i in range(3):
t.forward(10)
t.left(120)
for i in range(3):
t.forward(10)
t.right(120)
for i in range(3):
t.forward(10)
t.left(120)
for i in range(3):
t.forward(10)
t.right(120)
t.end_fill()

# Hide the turtle
t.hideturtle()

# Keep the window open
turtle.done()

techondemand_
join shbcf.ru