title: Alternating between players in a connect four python game
body: <p>I'm currently writing a function to play Connect Four in Python3. I've progressed well through much of it but am having trouble alternating between two players.</p>
  
  <p>What I'm trying to do is run a function that will place a chip in the appropriate location as a function of the current player, playturn(curr). So what I'm trying to say is that while there's no tie and while there's no winner, the game will continue and alternate between the two players. </p>
  
  <p>If it's Player 1's turn, <code>curr=1</code>, and if it's Player 2's turn, <code>curr=2</code>.</p>
  
  <p>My current code isn't working, as it won't allow me to switch between players after each turn if there's no tie or no winner. My logic here was that if <code>curr=1</code> is initially 1, then I'll have to set <code>curr=2</code> after the first move. Then, when <code>curr=2</code>, I have to switch curr equal back to 1. In the following code, <code>checkforwinner</code> and <code>checkfortie</code> are two functions that will return False if there is no winner and if there is no tie. <code>playturn(curr)</code> will place a chip in the correct column depending on the column chosen by either Player1 or Player2.</p>
  
  <pre><code>curr=1
  while checkforwinner==False and checkfortie==False:
      if curr==1:
          curr==2
          print(playturn(curr))
      if curr==2:
          curr==1
          print(playturn(curr))
  </code></pre>
  
  <p>Can someone explain why this code is not working and what can be done to fix it?</p>