picked = viz.pick() if picked == box: print 'box was picked' elif picked in (ball1,ball2,ball3): print 'one of the balls was picked'