Lights Out Puzzle Solver Python