214,454 views
8 votes
8 votes
Does anybody have the code to 4.3.4 colorful caterpillar in codehs ?

User Hadi Farah
by
2.5k points

1 Answer

26 votes
26 votes

Answer:

"""

This code will draw 8 circles t fore a multi colored caterpillar

"""

penup()

backward(140)

#define the fuction

def draw_circle(color_choice):

begin_fill()

color(color_choice)

circle (20)

end_fill()

forward(40)

#for loop to draw 8 circles

for i in range (8):

color_choice=input("Enter color:") #ask the user what color per circle

draw_circle(color_choice) #calling the functionStep-by-step explanation:

User Bubly
by
2.8k points