title: Setting variable to True does not exit while False loop
body: <p>I'm making a tic tac toe game using Python and I'm almost finished but I'm running into a problem with a while loop. Here is a shortened version of the function I use to check if a player has one.</p>
  <pre><code>def check_win(board, marker):
      win = False
      if board['A1'] == marker and board['B1'] == marker and board['C1'] == marker:
          print(f'{marker} wins!')
          win = True
      return win
  </code></pre>
  <p>And here it is in my code.</p>
  <pre><code>player_win = False
  while player_win == False:
      # Player1's turn
      board_dict = get_and_place_marker(board_dict, player1)
      display_board(board_dict)
  --&gt; player_win = check_win(board_dict, player1)
      # Player2's turn
      board_dict = get_and_place_marker(board_dict, player2)
      display_board(board_dict)
  --&gt; player_win = check_win(board_dict, player2)
  </code></pre>
  <p>In the first instance of check_win(), it does assign player_win to True but it doesn't exit the loop. It goes to Player2's code and then exits when Player2 wins. What am I doing wrong here? Shouldn't the first instant of player_win being assigned True exit the loop?</p>