title: random team generator with varying number of teams
body: <p>So I am about to learn how to code in python and therefore I am trying to make a random team generator as shown below.</p>
  <p>Currently, I have an output. However, the output I have is not how I want it to be.
  I have looked for a way to save the data from the while loop and export it out to the list created in the for loop and save the data each time. However, this seems to be an impossible assignment.</p>
  <pre><code>#team selector
  import random
  player_list=[]
  players=int(input('input number of players: '))
  teams= int(input('input number of teams: '))
  
  if players&lt;teams:
      print('to many teams, to few players')
  else:
      
      for i in range(0, players):
          names =input('input player {0}: '.format(i+1))
          player_list.append(names)
      print(player_list)
      
      while len(player_list)&gt;0:
          for i in range(0, teams):
              q=i+1
              teamq=[]
              
              while len(player_list)&gt;0:
                  z=i+1
                  playerz=random.choice(player_list)
                  teamq.append(playerz)
                  player_list.remove(playerz)
                  break
                  
                  if player_list==[]:
                      break
           
              print('team {0} is '.format(q), teamq)
  </code></pre>
  <p><strong>so currently my output is for instance</strong></p>
  <pre><code>input number of players: 5
  input number of teams: 3
  input player 1: James
  input player 2: peter
  input player 3: john
  input player 4: ann
  input player 5: Jackson
  ['James', 'Peter', 'John', 'Ann', 'Jackson']
  team 1 is  ['Peter']
  team 2 is  ['Jackson']
  team 3 is  ['James']
  team 1 is  ['Ann']
  team 2 is  ['John']
  team 3 is  []
  </code></pre>
  <p><strong>And what I want is</strong></p>
  <pre><code>input number of players: 5
  input number of teams: 3
  input player 1: James
  input player 2: peter
  input player 3: john
  input player 4: ann
  input player 5: Jackson
  ['James', 'Peter', 'John', 'Ann', 'Jackson']
  team 1 is  ['Peter', 'Ann']
  team 2 is  ['Jackson', 'John']
  team 3 is  ['James']
  </code></pre>
  <p>Can anyone help me?</p>