Explore

Close
Turtle Programs Share

Draw A Dog In Python Turtle With Code

Draw A Dog In Python Turtle With Code

Looking for a tutorial on how to draw a dog in python programming then you are at the right place today in this tutorial I will show you how to draw dog in python using turtle library so follow this tutorial till the end.

Drawing a dog using python is not going to be easy but you don’t have to worry about anything. I will provide you with the code of this program. You just have to follow this tutorial.

Want more python tutorials on drawing. I have created many python tutorials on drawing things, you can go here: python turtle programs.

The Complete Python Programming Boo...
The Complete Python Programming Bootcamp

Code To Draw Dog In Python Programming


import turtle as t
t.screensize(500, 500)
# 【 head outline 】
t.pensize(5)
t.home()
t.seth(0)
t.pd()  #pendown
t.color('black')
t.circle(20, 80)  # 0
t.circle(200, 30)  # 1
t.circle(30, 60)  # 2
t.circle(200, 29.5)  # 3
t.color('black')
t.circle(20, 60)  # 4
t.circle(-150, 22)  # 5
t.circle(-50, 10)  # 6
t.circle(50, 70)  # 7
#  determine the approximate position of the nose t.xcor and t. ycor the position of the tortoise at the beginning 
x_nose = t.xcor()
y_nose = t.ycor()
t.circle(30, 62)  # 8
t.circle(200, 15)  # 9
# 【 nose 】
t.pu() #penup
t.goto(x_nose, y_nose + 25)
t.seth(90)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
# 【 eye 】
t.pu()
t.goto(x_nose + 48, y_nose + 55)
t.seth(90)
t.pd()
t.begin_fill()
t.circle(8)
t.end_fill()
# 【 ear 】
t.pu()
t.color('#444444')
t.goto(x_nose + 100, y_nose + 110)
t.seth(182)
t.pd()
t.circle(15, 45) 
t.color('black')
t.circle(10, 15)  
t.circle(90, 70)  
t.circle(25, 110)  
t.rt(4)
t.circle(90, 70)  
t.circle(10, 15)  
t.color('#444444')
t.circle(15, 45) 
# 【 body 】
t.pu()
t.color('black')
t.goto(x_nose + 90, y_nose - 30)
t.seth(-130)
t.pd()
t.circle(250, 28)  
t.circle(10, 140)  
t.circle(-250, 25)  
t.circle(-200, 25)  
t.circle(-50, 85)  
t.circle(8, 145)  
t.circle(90, 45)
t.circle(550, 5)  
# 【 tail 】
t.seth(0)
t.circle(60, 85) 
t.circle(40, 65) 
t.circle(40, 60)  
t.lt(150)  #left
t.circle(-40, 90)  
t.circle(-25, 100)  
t.lt(5)
t.fd(20)
t.circle(10, 60)  
# 【 back 】
t.rt(80)  #right
t.circle(200, 35)
# 【 collar 】
t.pensize(20)
t.color('#F03C3F')
t.lt(10)
t.circle(-200, 25)  
# 【 love bell 】
t.pu()
t.fd(18)
t.lt(90)
t.fd(18)
t.pensize(6)
t.seth(35)  #setheading
t.color('#FDAF17')
t.begin_fill()
t.lt(135)
t.fd(6)
t.right(180)  #  brush turn around 
t.circle(6, -180)
t.backward(8)
t.right(90)
t.forward(6)
t.circle(-6, 180)
t.fd(15)
t.end_fill()
# 【 front calf 】
t.pensize(5)
t.pu()
t.color('black')
t.goto(x_nose + 100, y_nose - 125)
t.pd()
t.seth(-50)
t.fd(25)
t.circle(10, 150)
t.fd(25)
# 【 posterior calf 】
t.pensize(4)
t.pu()
t.goto(x_nose + 314, y_nose - 125)
t.pd()
t.seth(-95)
t.fd(25)
t.circle(-5, 150)
t.fd(2)
t.hideturtle()
t.done()

Above is the python code to draw a dog. Now to run this program you need to have python installed on your computer, If you don’t have then follow this guide: Install and setup python on your computer.

To run this python program, follow the below steps:

  • Create a new folder for this python project.
  • Open it in a code editor of your choice.
  • Create a python file with an ending .py extension.
  • Copy the above code and paste it in your file.

Now you have the code, but there is one last thing you need to do, as I have said. I have used the turtle library for this program, so you might need to install it if you get any errors like turtle module not found.

Turtle comes pre-installed with python setup, but if you get any errors, you can reinstall it using the below command.


pip install turtle

So now you have everything setup and you are ready to run the program, so to run this program open a command prompt at your program folder location and paste the below command.


python filename.py

The above command will run the program and it will open a new window and it will start drawing iron man and below is the finished drawing of a fog

dog drawing in python

As you can see, we successfully drew a dog using python turtle. I know it is not a perfect drawing of a dog but we will improve upon this program in the future.

Don’t want to create all the files and folders then you can run this program now using this online python compiler it is fast and easy.

Summary

This was the tutorial on drawing a dog in python programming. I hope you found this tutorial helpful and useful. Do share this tutorial with your friends who might be interested in this program.

Here are some more python drawing tutorial for you:

I hope you found what you were looking for from this tutorial, and if you want more python guides and tutorials like this, do join our Telegram channel for future updates.

Thanks for reading, have a nice day 🙂