Artist

Sign in to test your solution.
# Artist program # ------------------------- # Import libraries # ------------------------- import turtle, random # ------------------------- # 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()
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.

  Python sandbox

This window allows you to run Python code without installing a thing. The code you write here is not automatically submitted to Dodona.