Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I tried to draw Bart Simpson through turtle Python. I almost made it but when it draws around the mouth part, the yellow does not
I tried to draw Bart Simpson through turtle Python. I almost made it but when it draws around the mouth part, the yellow does not fill in. I could not solve it by myself..import turtlescreen = turtle.Screen()screen.bgcolor('lightblue')t = turtle.Turtle()def bart_face(): t.speed(0) t.penup() t.goto(-400, -400) t.pendown() t.color("black", "yellow") t.begin_fill() t.left(85) for q in range(180): t.left(0.05) t.forward(1) t.left(90) for x in range(210): t.forward(1) t.right(1) t.penup() t.left(190) t.forward(30) t.pendown() t.right(60) t.forward(600) # bart hair line t.right(127) t.forward(96) t.left(103) t.forward(100) t.right(140) for i in range(1, 10): t.forward(100) t.left(135) t.forward(100) t.right(135) t.right(20) t.forward(100) t.right(5) t.forward(30) t.right(3) t.forward(200) t.left(3) t.forward(50) t.right(-40) for y in range(70): t.forward(0.5) t.right(0.5) t.end_fill() def bart_eyes(): # bart right eye t.left(180) t.color("black", "white") t.begin_fill() t.right(-40) t.circle(120) t.end_fill() t.penup() t.left(90) t.forward(120) t.pendown() t.color("black") t.begin_fill() t.circle(10) t.end_fill() # the left eye t.penup() t.right(65) t.forward(260) t.pendown() t.color("black", "white") t.begin_fill() t.left(40) t.circle(120) t.end_fill() t.penup() t.left(90) t.forward(120) t.pendown() t.color("black") t.begin_fill() t.circle(10) t.end_fill() bart_eyes() t.penup() t.right(-45) t.forward(120) t.pendown() def bart_nose(): t.color("black", "yellow") t.begin_fill() t.left(25) t.forward(150) for z in range(150): t.forward(1) t.right(1) t.right(30) for f in range(1, 10): t.forward(11) t.right(0.5) t.end_fill() bart_nose() t.color("black", "yellow") t.begin_fill() t.penup() t.right(174.5) t.forward(110) t.pendown() for a in range(1, 5): t.right(87) t.forward(25) t.left(90) t.right(90) t.end_fill() for b in range(50): t.forward(1) t.right(1) t.right(50) for c in range(1, 30): t.right(0.5) t.forward(15) t.right(140) for d in range(40): t.forward(1) t.right(1) t.left(180) for e in range(90): t.forward(1) t.left(1) t.end_fill() # neck part t.color("black", "yellow") t.begin_fill() t.penup() t.left(104.5) t.forward(200) t.pendown() t.right(90) for g in range(60): t.forward(1.4) t.right(0.9) for h in range(40): t.forward(1.2) t.right(0.3) for i in range(100): t.forward(2) t.left(0.5) t.right(85) for j in range(157): t.forward(2) t.right(0.1) t.right(76) t.forward(20) t.end_fill()bart_face()turtle.done()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started