title: Cannot append list with condition
body: <p>im trying to export two lists to an excel file using pandas, but i cannot append my data using this method.</p>
  <pre><code>product_list1 = [&quot;apple&quot;, &quot;pear&quot;, &quot;oragne&quot;, &quot;melon&quot;]
  product_list2 = [&quot;bread&quot;, &quot;sugar&quot;, &quot;flour&quot;, &quot;salt&quot;]
  list_codes = []
  list_numbers = []
  
  def quantity_check(list_type, list_number):
      choise = input(&quot;Quantity:&quot;)
      if choise in range(1, 99):
          list_numbers.append(choise)
          list_codes.append(list_type[list_number])
  quantity_check(product_list1,0)
  quantity_check(product_list1,1)
  quantity_check(product_list1,2)
  quantity_check(product_list1,3)
  
  print (list_numbers)
  print (list_codes)
  </code></pre>
  <p>This outputs the two empty lists for some reason.</p>