Draw a snowman using a turtle module in Python

preview_player
Показать описание
In this video, I will show you how to use the turtle module in Python and draw a snowman. The turtle module is an important part of the Python programming language. It provides the user with a simple environment, with commands that are easy to learn and remember.
Draw a snowman using the turtle module in Python
# Import required module
import turtle
# Create a turtle object
t = turtle.Turtle()

# Create a screen
screen =turtle.Screen()

# Set background color
# Function to draw body of snowman
def draw_circle(color, radius, x, y):



# Illustrating snowman
# Drawing snowman body
draw_circle ("#ffffff", 30, 0, -40)
draw_circle ("#ffffff", 40, 0, -100)
draw_circle ("#ffffff", 60, 0, -200)

# Drawing left eye
draw_circle ("#ffffff", 2, -10, -10)

# Drawing right eye
draw_circle ("#ffffff", 2, 10, -10)

# Drawing nose
draw_circle ("#FF6600", 3, 0, -15)

# Drawing buttons on
draw_circle ("#ffffff", 2, 0, -35)
draw_circle ("#ffffff", 2, 0, -45)
draw_circle ("#ffffff", 2, 0, -55)



# Function to draw arms
def create_line(x, y, length, angle):



# Drawing left arm
create_line(-70, -50, 50, 160)

# Drawing right arm
create_line(70, -50, 50, 20)



# Drawing hat

Рекомендации по теме
Комментарии
Автор

Love this video, I think I’ve watched it four times

acsgk
Автор

I truly love your channel. Keep doing the best work.

acsgk
welcome to shbcf.ru