atlast I have managed to get some working code but the first problem is that I have is taht.. when I call draw(2,4) I have a column of 2 circles and 4 rows and I would actually like it to be a clomun of 2 and row of 4. Secodly although my code works I have a main function and an input for an colour how could I fill the circles with the requested colour?
like
This is what i currently have
00
00
00
00
I want it like
0000
0000
from graphics import *
def main():
colour = raw_input("Enter the colour: ")
def drawCircle(win, centre, radius, colour, color):
circle = Circle(centre, radius)
circle.setFill(colour)
circle.setOutline(color)
circle.draw(win)
def drawWindow(win, center, radius):
drawCircle(win, center, radius, "white", "black")
def draw(rows, columns):
radius = 50
diameter = 2 * radius
width = rows*diameter+1
height = columns*diameter+1
win = GraphWin("", width, height )
for x in range( rows ):
for y in range( columns ):
xPosition = radius + 2 + diameter * x
yPosition = radius + 2 + diameter * y
center = Point( xPosition, yPosition )
drawWindow( win, center, radius )
main()