Tic-tac-toe doubt

sir, my code is allowing me to make only 2-3 moves after which it stops taking moves, don’t know what error is this.