CSCI 107 Assignment 6


Piet Mondrian was a Dutch artist who liked to place rectangles of various shapes and colors on a canvas. Here is one such example. For Assignment 6, you are going to write a Python program that randomly generates Mondrian-like art.

The user should be asked to enter (1) the number of rectangles that should be drawn, (2) the maximum width of a rectangle in pixels and (3) the maximum height of a rectangle in pixels. The Python program, running in IDLE, should then draw the appropriate number of rectangles where each rectangle is randomly colored, randomly positioned and randomly sized. Here is a drawing that might result if the user requests 200 rectangles with a maximum width of 100 pixels and a maximum height of 100 pixels.

Requirements and Grading - 100 points

Use the IDLE environment to develop your solution.

Helpful Hint


Place the solution in a file named and submit it to the D2L Dropbox no later than 11:59 p.m. on Friday, October 21st. Late submissions receive no credit, but partial credit can be earned by making an ontime submission.

Valid XHTML 1.0!