Warning! It seems that you are using Dodona within another webpage, so not everything may work properly. Let your teacher know so that he can solve the problem by adjusting a setting in the learning environment. In the meantime, you can click this link to open Dodona in a new window.
Warning! The page was not fully loaded, probably because of a network issue. It could be that not all functionalities work as expected. Please try reloading the page.
Artist
Sign in to test your solution.
# Artist program
# -------------------------
# Import libraries
# -------------------------
import turtle, random
turtle.setup(800, 800)
# -------------------------
# Subprograms
# -------------------------
def make_art():
for circles in range(50):
for turtle_number in range(number_of_turtles):
direction = random.randint(0, 360)
t[turtle_number].setheading(direction)
t[turtle_number].penup()
t[turtle_number].forward(30)
t[turtle_number].pendown()
t[turtle_number].setheading(0)
t[turtle_number].circle(20)
# -------------------------
# Main program
# -------------------------
number_of_turtles = 2
colour_list = ["Red", "Blue"]
t = []
for turtle_number in range(number_of_turtles):
new_turtle = turtle.Turtle()
new_turtle.speed("fastest")
new_turtle.pencolor(colour_list[turtle_number])
new_turtle.hideturtle()
t.append(new_turtle)
make_art()
turtle.done()