Tic-tac-toe in python