title: Mondrian Art Program Python
body: <p>I'm trying to create a Mondrian Art program....I have the code that generates the squares randomly..but I'm having trouble randomly filling the squares with primary colors? Does anyone know how to fix that? This is my code:</p>
  
  <pre><code>import turtle
  import random
  
  
  turtle.screensize(1000,1000)
  turtle.setworldcoordinates(-500,-500,500,500)
  
  piet = turtle.Turtle()
  piet.speed(300)
  
  #primary colors, red, blue, yellow
  #piet.color(red,blue,yellow)
  
  rectangles = int(input('How many rectangles should be drawn? '))
  rectangle_w = int(input('What should be the max width of the rectangles? '))
  rectangle_h = int(input('What should be the max height of the rectangles? '))
  
  def mondrian(t,random_w,random_h):
      piet.begin_fill()
      for number_r in range(1):
          for box in range(2):
              t.left(90)
              t.forward(random_w)
              t.left(90)
              t.forward(random_h)
      piet.end_fill()
  
  
  
  mondrian(piet,random.randint(10,rectangle_w),random.randint(10,rectangle_h))
  
  def repeat_mondrian():
      for i in range(rectangles - 1):
          mondrian(piet, random.randint(10, rectangle_w), random.randint(10, rectangle_h))
  
  repeat_mondrian()
  </code></pre>
  
  <p>Thanks! :)</p>