Ask coding questions

← Back to all posts
2
what's wrong with code?
Prashant01 (1)

https://repl.it/@Prashant01/first-proj
color is not completely filled
import turtle
t=turtle.Turtle()
t.color("red")
t.begin_fill()
for i in range(4):
t.fd(100)
t.left(90)
t.circle(50)
for count in range(3):
t.fd(100)
t.right(120)
t.left(90)
for i in range(3):
t.fd(100)
t.left(120)
t.fd(100)
t.right(90)
for i in range(3):
t.fd(100)
t.left(120)
t.fd(100)
t.right(90)
for i in range(3):
t.fd(100)
t.left(120)
t.end_fill()

Answered by ReshiramWolfu (60) [earned 5 cycles]
View Answer
Commentshotnewtop
1
ReshiramWolfu (60)

All you needed was to begin and end the fill around the section:
t.begin_fill()
for i in range(4):
t.fd(100)
t.left(90)
t.circle(50)
t.end_fill()
t.begin_fill # then begin it again
for count in range(3):
t.fd(100)
t.right(120)
t.left(90)
for i in range(3):
t.fd(100)
t.left(120)
t.fd(100)
t.right(90)
for i in range(3):
t.fd(100)
t.left(120)
t.fd(100)
t.right(90)
for i in range(3):
t.fd(100)
t.left(120)
t.end_fill()

1
ReshiramWolfu (60)

I figured out how to fill that part, without the triangles being filled on the outside

1
Prashant01 (1)

@ReshiramWolfu I need complete to be filled. How to do that ?

1
ReshiramWolfu (60)

@Prashant01 Haven't figured it out yet, but i am trying

1
ReshiramWolfu (60)

No need to post twice, but i will check your code anyway.

1
Prashant01 (1)

@ReshiramWolfu Sorry In first one I didn't kept link so I posted twice.