title: Removing things from lists in Python
body: <p>When I run this program, I would like it to remove whatever number has been chosen, and not make it reappear the next time it loops through the code, however when it loops through the code for a second time it completely forgets about removing the number from the first time.
  Please help (sorry I'm not great at explaining)</p>
  <p>part with problem</p>
  <pre><code>while Play_game == True:
  
  # play the game
  
  colour = [&quot;Red&quot;, &quot;Yellow&quot;, &quot;Black&quot;]
  
  # create the colour and number for player 1
  number_R_1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_Y_1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_B_1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  colour_p_1 = random.choice(colour)
  
  if colour_p_1 == &quot;Red&quot;:
      number_p_1 = random.choice(number_R_1)
      number_R_1.remove(number_p_1)
  
  elif colour_p_1 == &quot;Yellow&quot;:
      number_p_1 = random.choice(number_Y_1)
      number_Y_1.remove(number_p_1)
  
  elif colour_p_1 == &quot;Black&quot;:
      number_p_1 = random.choice(number_B_1)
      number_B_1.remove(number_p_1)
  
  # create the colour and number for player 2
  
  colour_p_2 = random.choice(colour)
  
  number_R_2 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_Y_2 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_B_2 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  
  if colour_p_2 == &quot;Red&quot;:
      number_p_2 = random.choice(number_R_2)
      number_R_2.remove(number_p_2)
  
  elif colour_p_2 == &quot;Yellow&quot;:
      number_p_2 = random.choice(number_Y_2)
      number_Y_2.remove(number_p_2)
  
  elif colour_p_2 == &quot;Black&quot;:
      number_p_2 = random.choice(number_B_2)
      number_B_2.remove(number_p_2)
  
  input(&quot;{0} press enter to pick up a card&quot;.format(user_1))
  print(&quot;{0}'s draw : &quot;.format(user_1))
  player_1_colour = print(colour_p_1)
  player_1_number = print(number_p_1)
  
  input(&quot;{0} press enter to pick up a card&quot;.format(user_2))
  print(&quot;{0}'s draw : &quot;.format(user_2))
  player_2_colour = print(colour_p_2)
  player_2_number = print(number_p_2)
  </code></pre>
  <p>full code</p>
  <pre><code># Card Game
  
  # modules needed
  import random
  import time
  
  # introduce the players to the game and the rules
  
  
  Rules = True
  Authenticate = False
  Play_game = False
  
  while Rules == True:
  print(&quot;Hello and welcome to the Card Game, in this game there are 3 rules.&quot;)
  time.sleep(4)
  print(&quot;Rule number one: Each player takes their turn to take a card from the draw pile&quot;)
  time.sleep(5)
  print(&quot;Rule number two: There are 3 different coloured cards you could have collected as well as &quot;
        &quot;30 different numbers,if both players gain the same colour who ever has the highest number wins &quot;
        &quot;if you don't have the same colour then this is how it will work:&quot;)
  time.sleep(10)
  print(&quot; &quot;)
  print(&quot;card  | card  | winner&quot;)
  print(&quot;----------------------&quot;)
  print(&quot;Red   | Black | Red&quot;)
  print(&quot;----------------------&quot;)
  print(&quot;Yellow|  Red  | Yellow&quot;)
  print(&quot;----------------------&quot;)
  print(&quot;Black | Yellow| Black&quot;)
  print(&quot; &quot;)
  print(&quot;Rule number three: You will play until there are no cards left in the deck, who ever has the most 
  cards win, good luck!&quot;)
  print(&quot; &quot;)
  
  #give the user an option of play, rules or exit
  
  options = input(&quot;Would you like to play, exit or read the rules again? (type play, exit, rules) : &quot;)
  
  if options == &quot;rules&quot; or options == &quot;Rules&quot;:
      Rules = True
  elif options == &quot;exit&quot; or options == &quot;Exit&quot;:
      exit()
  
  elif options == &quot;play&quot; or options == &quot;Play&quot;:
      Rules = False
      Authenticate = True
  
  else:
      print(&quot;Sorry this was not an option (you can only choose play, exit or rules)&quot;)
  
  #Get the players names
  user_1 = input(&quot;Before we begin, what is your name user 1? :&quot;)
  print(&quot;You have a very nice name {0}&quot;.format(user_1))
  user_2 = input(&quot;What is your name user 2? :&quot;)
  print(&quot;you also have a very nice name {0}&quot;.format(user_2))
  
  while Authenticate == True:
  
  #authenticate the user
  
  Authentication = input(&quot;Have you already created an account? (Yes or No) : &quot;)
  if Authentication == &quot;yes&quot; or Authentication == &quot;Yes&quot;:
      Play_game = True
      Authenticate = False
  elif Authentication == &quot;no&quot; or Authentication == &quot;No&quot;:
      print(&quot;sorry this isnt completed yet please type Yes&quot;)
  else:
      print(&quot;This was not an option the only options were Yes or No!&quot;)
  
  
  number_R_2 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_Y_2 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_B_2 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  
  while Play_game == True:
  
  # play the game
  
  colour = [&quot;Red&quot;, &quot;Yellow&quot;, &quot;Black&quot;]
  
  # create the colour and number for player 1
  number_R_1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_Y_1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  number_B_1 = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
  colour_p_1 = random.choice(colour)
  
  if colour_p_1 == &quot;Red&quot;:
      number_p_1 = random.choice(number_R_1)
      number_R_1.remove(number_p_1)
  
  elif colour_p_1 == &quot;Yellow&quot;:
      number_p_1 = random.choice(number_Y_1)
      number_Y_1.remove(number_p_1)
  
  elif colour_p_1 == &quot;Black&quot;:
      number_p_1 = random.choice(number_B_1)
      number_B_1.remove(number_p_1)
  
  # create the colour and number for player 2
  
  colour_p_2 = random.choice(colour)
  
  if colour_p_2 == &quot;Red&quot;:
      number_p_2 = random.choice(number_R_2)
      number_R_2.remove(number_p_2)
  
  elif colour_p_2 == &quot;Yellow&quot;:
      number_p_2 = random.choice(number_Y_2)
      number_Y_2.remove(number_p_2)
  
  elif colour_p_2 == &quot;Black&quot;:
      number_p_2 = random.choice(number_B_2)
      number_B_2.remove(number_p_2)
  
  input(&quot;{0} press enter to pick up a card&quot;.format(user_1))
  print(&quot;{0}'s draw : &quot;.format(user_1))
  player_1_colour = print(colour_p_1)
  player_1_number = print(number_p_1)
  
  input(&quot;{0} press enter to pick up a card&quot;.format(user_2))
  print(&quot;{0}'s draw : &quot;.format(user_2))
  player_2_colour = print(colour_p_2)
  player_2_number = print(number_p_2)
  </code></pre>