Colorful Squares Python Program Using Nested Loops

I’m trying to create a program in python that draw columns and rows of squares. There can only be 3 rows and 3-12 columns. The user must input how many columns they want and what 3 colors they want the rows to be. I’m struggling with how to line up the rows underneath each other and how to make it centered on the screen. I’m also struggling with how to make each row a different color. Any suggestions would help. Thank you! This is what I have so far.

import turtle
ROWS = 3
OFFSET = 10
cols = int(input('How many columns to display (3-12)? '))

color1 = input('What is the first color? ')
color2 = input('What is the second color? ')
color3 = input('What is the third color? ')

if cols < 3 or cols > 12:
  print('Error! Number of columns must be in range of 3 to 12.')

elif color1 == color2 or color1 == color3:
  print('Error! All the colors must be different!')
elif color2 == color1 or color2 == color3:
  print('Error! All the colors must be different!')
elif color3 == color1 or color3 == color2:
  print('Error! All the colors must be different!')
else:
  for r in range(ROWS):
    y = turtle.ycor() - 115
    x = turtle.xcor() 
    turtle.penup()
    turtle.goto(x,y)
    turtle.pendown()
    turtle.fillcolor(color1)
    turtle.begin_fill()
    for c in range(cols):
      x = turtle.xcor() + 95
      y = turtle.ycor()
      turtle.penup()
      turtle.goto(x,y)
      turtle.pendown()
      for side in range(4):
        turtle.forward(50)
        turtle.left(90)
    turtle.end_fill()

This is what I’m trying to do.