title: Python Rock,Paper,Scissors User Input in a while loop
body: <p>I am making a simple rock paper scissors terminal program in python and I want the player to input their name only once throughout the game.</p>
  <pre><code>from random import random, randint
  import random
  
  running = True
  global p_wins,p_losses,p_draws,c_wins,c_losses,c_draws
  p_wins = 0
  p_losses = 0
  p_draws = 0
  c_wins = 0
  c_losses = 0
  c_draws = 0
  
  while running == True:
      print(&quot;=====Rock Paper Scissors: The Python Game=====&quot;)
      print(&quot;\n&quot;)
  #Point System
      def Score():
  
          print(&quot;====Player's Score====&quot;)
          print(f&quot;Wins:{p_wins}&quot;)
          print(f&quot;Losses:{p_losses}&quot;)
          print(f&quot;Draws:{p_draws}&quot;)
  
          print(&quot;====CPU's Score====&quot;)
          print(f&quot;Wins:{c_wins}&quot;)
          print(f&quot;Losses:{c_losses}&quot;)
          print(f&quot;Draws:{c_draws}&quot;)
  
      name = input(&quot;Player please enter you name:\n&quot;)
      print(&quot;\n&quot;)
  
      if name == str(name):
          pass
  
  
      if len(name) &gt; 12:
          print(&quot;Player's name is TOO long&quot;)
          break
  
      myItem = input(&quot;Enter Either Rock Paper or Scissors:\n&quot;)
  
  
      if myItem not in (&quot;Rock&quot;,&quot;Paper&quot;,&quot;Scissors&quot;):
         print(&quot;Are you Ok!! I said enter rock paper or scissors&quot;)
         print(&quot;GAME OVER!!!!!!&quot;)
         break
      
  
  #Computer's Choices
      computerItem = random.randint(1,3)
      if computerItem == 1:
          computerItem = &quot;Rock&quot;
          print(f&quot;Computer chooses {computerItem}...&quot;)
      if computerItem == 2:
          computerItem = &quot;Paper&quot;
          print(f&quot;Computer chooses {computerItem}...&quot;)
      if computerItem == 3:
          computerItem = &quot;Scissors&quot;
          print(f&quot;Computer chooses {computerItem}...&quot;)
  
  
      if myItem == computerItem:
          print(&quot;Try Again!! You and the CPU picked the same thing&quot;)
          p_draws += 1
          c_draws += 1
          Score()
          
  
  #How I can loose to the CPU
      if myItem == &quot;Rock&quot; and computerItem == &quot;Paper&quot;:
          print(&quot;[Paper covers Rock]&quot;)
          print(&quot;CPU WINS!!!&quot;)
          p_losses += 1
          c_wins += 1
          Score()
          
      if myItem == &quot;Paper&quot; and computerItem == &quot;Rock&quot;:
          print(&quot;[Paper covers Rock]&quot;)
          print(f&quot;{name} WINS!!!&quot;)
          p_wins += 1
          c_losses += 1
          Score()
  
      if myItem == &quot;Scissors&quot; and computerItem == &quot;Rock&quot;:
          print(&quot;[Rock Smashes Scissors]&quot;)
          print(&quot;CPU WINS!!!&quot;)
          p_losses += 1
          c_wins += 1
          Score()
          
      if myItem == &quot;Rock&quot; and computerItem == &quot;Scissors&quot;:
          print(&quot;[Rock smashes Scissors]&quot;)
          print(f&quot;{name} WINS!!!&quot;)
          p_wins += 1
          c_losses += 1
          Score()
          
  
      if myItem == &quot;Paper&quot; and computerItem == &quot;Scissors&quot;:
          print(&quot;[Scissors cut Paper]&quot;)
          print(&quot;CPU WINS!!!&quot;)
          p_losses += 1
          c_wins += 1
          Score()
          
  
      if myItem == &quot;Scissors&quot; and computerItem == &quot;Paper&quot;:
          print(&quot;[Scissors cut Paper]&quot;)
          print(f&quot;{name} WINS!!!&quot;)
          p_wins += 1
          c_losses += 1
          Score()
  
      nextRound = 1
          
  
      quitGame = input(&quot;Do you want to continue playing (Y/N):\n&quot;)
  
      if quitGame == &quot;N&quot;:
           break
  </code></pre>
  <p>Everything else is running smoothly and without issue. I want the player to input their name only at the beginning and not at the start of every round.</p>
  <pre><code>if name == str(name):
          pass
  </code></pre>
  <p>I have a rough idea but I don't know how to implement it. Please can anyone help?
  PS - I am a beginner</p>