For this assignment, we were tasked with drawing an image in Python. I chose to draw a pig and it seemed easy, but it really wasn't. My biggest problem while trying to draw a pig was making the ears. They required multiple loops and eventually I just settled with what I had at that moment. Other than making the ears of the pig, I felt that this assignment was pretty easy. I think that choosing a simple thing to draw made the assignment easy, but I just wanted to do something simple so I could finish before the end of the year.
#Importing the turtle and naming it
import turtle
t = turtle.Turtle()
#Making the head of the pig
t.color('pink')
t.dot(500)
#Making the nose of the pig
t.pensize(4)
t.color('black')
t.penup()
t.right(90)
t.forward(20)
t.right(90)
t.forward(10)
t.pendown()
t.circle(90)
t.penup()
t.left(90)
t.forward(100)
t.right(90)
t.forward(30)
t.left(90)
t.pendown()
t.dot(40)
t.penup()
t.left(90)
t.forward(60)
t.dot(40)
t.penup()
#Making the eyes of the pig
t.left(90)
t.forward(260)
t.color('white')
t.right(90)
t.forward(54)
t.dot(100)
t.color('black')
t.dot(50)
t.penup()
t.right(180)
t.forward(150)
t.color('white')
t.pendown()
t.dot(100)
t.color('black')
t.dot(50)
#Making the ears of the pig
t.pensize(20)
t.penup()
t.right(90)
t.forward(85)
t.color('pink')
t.pendown()
t.begin_fill()
t.forward(30)
for i in range(10) : #10 Loop
t.left(5)
t.forward(5)
t.left(30)
t.forward(7)
t.left(87)
for i in range(10) : #Another 10 loop
t.left(1)
t.forward(10)
t.left(10)
t.forward(10)
t.end_fill()
t.penup()
t.color('black')
t.left(91)
t.forward(200)
t.left(89)
t.color('pink')
t.pendown()
t.begin_fill()
t.forward(30)
for i in range(10) : #Another 10 loop
t.left(5)
t.forward(7)
t.left(30)
t.forward(7)
t.left(87)
for i in range(10) : #Another 10 loop
t.left(1)
t.forward(10)
t.left(10)
t.forward(10)
t.end_fill()
t.penup()
t.color('black')
#Making the smile of the pig
t.pensize(3)
t.right(26)
t.forward(430)
t.left(95)
t.pendown()
t.forward(40)
for i in range(20) :
t.forward(6)
t.left(3)
t.hideturtle()