title: Appending elements to a list based on condition
body: <p>I was trying to append few elements to a list  <code>list_accepted_outsidenestant</code>. When i try to print the list <code>list_accepted_outsidenestant</code>, i get: <code>list_accepted_outsidenestant- [([971, 977, 728, 740], set([728, 977, 971, 740]))]</code>. The list is showing a list and set with same elements. Can anyone pointout the mistake i am doing? Because of this, i am getting an error: <code>
  set_accepted_outsidenest_antlist = set(list_accepted_outsidenestant
  TypeError: unhashable type: 'list'</code></p>
  
  <p>I have shown part of code only relevant to the current question.</p>
  
  <pre><code>def leo(tag_data):
      available_ants_outside = []
      ori = []
      for id, (x, y) in tag_data:
          available_ants_outside.append(id)
          if for_coordinates_outside_nest((x, y)) is True:
              ori.append(id)
      return ori
  
  
  def virgo(tag_data):
      available_ants_inside = []
      list_insidenest_ant_id = []
      set_inside_nest_ant_id = set()
      for id, (x, y) in tag_data:
          available_ants_inside.append(id)
          if for_coordinates_inside_nest((x, y)) is True:
              list_insidenest_ant_id.append(id)
              set_inside_nest_ant_id = set(list_insidenest_ant_id)
              return list_insidenest_ant_id,set_inside_nest_ant_id
  
   def bambino(ori,list_insidenest_ant_id):
      list_accepted_outsidenestant = []                       
      set_accepted_outsidenest_antlist = set()
      set_accepted_insidenest_antlist = set()
      if len(list_accepted_outsidenestant) &lt; num_accepted:
          if (len(ori) &gt; 0) or (len(list_insidenest_ant_id) &gt;0):
              list_accepted_outsidenestant.extend(ori[0:min(len(ori),             
              num_accepted-len(list_accepted_outsidenestant))])
              set_accepted_outsidenest_antlist = set(list_accepted_outsidenestant)  
              print "list_accepted_outsidenestant-" + str(list_accepted_outsidenestant)
              set_accepted_insidenest_antlist  = set(list_insidenest_ant_id)
      return set_accepted_outsidenest_antlist,set_list_outsideant_id,set_accepted_insidenest_antlist
  </code></pre>