beginner – "First Python Program: Tic-Tac-Toe (Followup)

This is the new code, I'm not sure I made suggestions from my previous article First Python Program: Tic-Tac-Toe.
I have only been working on programming for about 3 weeks, so any suggestion or suggestion on the original post suggestions would be more than welcome.

& # 39; & # 39; & # 39; python 3.7.4 & # 39; & # 39; & # 39;

import system
since deduction of import textwrap
bone import
randomly import

os.system (& # 39; CLS & # 39;)

card number configuration
board = [0, 1, 2,
         3, 4, 5,
         6, 7, 8]


# Set the layout printed on the console
def board_layout ():
print (deduce (& # 39; & # 39; & # 39; & # 39; & # 39; & # 39;
*************
* {board[0]} | {board[1]} | {board[2]} *
* ----------- *
* {board[3]} | {board[4]} | {board[5]} *
* ----------- *
* {board[6]} | {board[7]} | {board[8]} *
*************
& # 39; & # 39; & # 39;))


def ():
players = (& # 39; Player & # 39; NPC & # 39;)
turn = "player"
change_turn = 0
for trips within reach (9):
if ==> Player:
while true:
try:
board_layout ()
player_move = int (input (& # 39; please select a location: & nbsp;))
if advice[player_move] ! = & # 39; x & # 39; and advice[player_move] ! = & # 39; o
board[player_move] = & # 39; x & # 39;
check_winner ()
Pause
except IndexError:
print (please select a valid location)
if == NPC:
# npc move, choose a random location that is not taken
while true:
npc = random.randint (0, 8)
if advice[npc] ! = & # 39; o & # 39; and advice[npc] ! = & # X;
board[npc] = & # 39; o & # 39;
print ('Computer chooses spot', npc)
check_winner ()
Pause
try:
change_turn + = 1
turn = players[change_turn]
        except:
change_turn = 0
turn = players[change_turn]
    other:
print (& # 39; You have attached & # 39;)
end()





def end ():
print ('Thank you for playing')
answer = input ('Want to play again ?: Y / N')

if answer.lower () == n:
to leave()
elif answer.lower () == & # 39; y & # 39;
clear_board ()
main ()
other:
print ('Please choose a valid option')
end()

clear_board () def:
for i in the range (9):
board[i] = i

# look for a winner when he is called at the end of each round
def check_winner ():

# list of lists with all the winning combinations of the table tic tac toe
win_list =[[board[[board[[planche[[board[0], board[1], board[2]],[board[board[planche[board[3], board[4], board[5],],[board[board
                            [board[6], board[7], board[8]],[board[board[planche[board[0], board[4], board[8]],[board[board
                            [board[2], board[4], board[6]],[board[board
                            [board[0], board[3], board[6]],[board[board[planche[board[1], board[4], board[7]],[board[board
                            [board[2], board[5], board[8]]]# iterate on the win_list lists
for i, j, k in winner_list:
# look at lists in win_list to determine if a list contains all x to win
if i == x & # 39; and j ==> x & # 39; and k == & xp ;:
print (X wins)
end()
# look at lists in win_list to determine if a list contains all o's to win
elif i == & # 39; o & # 39; and j == & # 39; o & # 39; and k == & o,
print (O wins)
end()


if __name__ == "__main__":
main ()