Python Programming – John Zelle: Chapter 4 ex. 3

Write a program that draws some sort of face.

#Chapter 4 Exercise 3
#Write a program that draws some sort of face.

def main():
    #head
    win = GraphWin('Face',300,300)
    f = Oval(Point(75,50),Point(225,250))
    f.setFill('pink')
    f.draw(win)

    #eyes
    el = Circle(Point(120,120),15)
    el.setFill('white')
    el.draw(win)
    ebl = Circle(Point(120,120),5)
    ebl.setFill('black')
    ebl.draw(win)

    er = Circle(Point(180,120),15)
    er.setFill('white')
    er.draw(win)
    ebr = Circle(Point(180,120),5)
    ebr.setFill('black')
    ebr.draw(win)

    #mouth
    n = Oval(Point(110,185),Point(190,225))
    n.setFill('black')
    n.draw(win)

    #nose
    n = Oval(Point(125,110),Point(175,190))
    n.setFill('pink')
    n.draw(win)

    win.getMouse() # pause for click in window
    win.close()

main()

Run =
4-3