# c05ex02.pyw

2018-03-29  本文已影响0人  特丽斯纳普

c05ex02.pyw

An archery target.

from graphics import *

def main():
# Create a window
win = GraphWin("Archery Target", 400, 400)
win.setCoords(-6, -6, 6, 6)
win.setBackground("gray")
center = Point(0,0)

c1 = Circle(center, 5)
c1.setFill("white")
c1.draw(win)

c2 = Circle(center, 4)
c2.setFill("black")
c2.draw(win)

c3 = Circle(center, 3)
c3.setFill("blue")
c3.draw(win)

c4 = Circle(center, 2)
c4.setFill("red")
c4.draw(win)

c5 = Circle(center, 1)
c5.setFill("yellow")
c5.draw(win)

win.getMouse()
win.close()

main()

上一篇下一篇

猜你喜欢

热点阅读