Can someone help me with this code.. I get an error when I try to execute it

from graphics import *
def main():
    colour = raw_input("Enter the colour: ")
    win = GraphWin("Patch", 200, 200)
    drawCircle(win, 50, 50, colour)

def drawCircle(win, x, y, colour):
    for i in range(5):
        for j in range(5):
            if (i + j) % 2 == 0:
                topLeftX = x + i * 20
                topLeftY = y + j * 20
                circle = Circle(Point(topLeftX, topLeftY),
                                      Point(topLeftX + 20, topLeftY + 20))

What error do you get?

What error do you get?

Traceback (most recent call last):
File "C:/Documents and Settings/Compaq_Owner/Desktop/0", line 19, in <module>
File "C:/Documents and Settings/Compaq_Owner/Desktop/0", line 6, in main
drawCircle(win, 50, 50, colour)
File "C:/Documents and Settings/Compaq_Owner/Desktop/0", line 15, in drawCircle
Point(topLeftX + 20, topLeftY + 20))
File "C:\Python26\lib\site-packages\", line 611, in __init__
p1 = Point(center.x-radius, center.y-radius)
TypeError: unsupported operand type(s) for -: 'int' and 'instance'

The correct arguments for Circle() are (center_point, radius) and you gave two points.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.