Little chess game with python
The game logic is broken in many respects.
First, the game may reach an &quot;insufficient material&quot; condition, in which checkmate is impossible. Infinite loop right away.
Second, the game may get into a stalemate. There is no legal moves in a stalemate, so pact would reject anything the user tries to enter. Yet another infinite loop.
Finally, the end of game condition shall be tested after each half-move. BTW, chess module conveniently offers a board.is_game_over() method, which encompasses everything above, plus three-fold repetition, plus 50 moves rule.

Board is printed only after a computer move. This is strange.

Listing the legal moves unconditionally is annoying. It should only be printed when the player enters an illegal one.

When you feel compelled to put a comment like
  def pact():  # Player's Action

it means that you fail to express yourself clearly in the code. Giving the function a meaningful name, like
  def player_action():

eliminates the need to comment it.