title: how do I use append in a while loop?
body: <p>I can enter a valid gtin eg(12345670, 13245627) and 2 quantities but don't know why they don't both appear in the list when i use the append function, it just prints the last one.</p>
  
  <pre><code>products = {}
  fi = open("prod_file.txt","r")
  for line in fi:
      l = line.rstrip().split(":")
      products[l[0]] = {"desc" : l[1], "price" : l[2], "stock" : int(l[3]), "reorder" : int(l[4]), "target" : int(l[5])}
  fi.close
  gtin_valid()
  
  cont=False
  while not cont:
      quantity=input("enter qty: ")
      if quantity.isdigit():
          qty=[quantity]
          gtin8=[gtin]
          qty.append(quantity)
          gtin8.append(gtin)
          carryon=input("do you want to continue? ")
          if carryon[0]=="n":
              cont=True
              print(qty,gtin8)
          else:
              gtin_valid()
              quantity=input("enter qty: ")
  
      else:
          print("Please enter numbers only ")
          gtin_valid()
          quantity=input("enter qty: ")
  </code></pre>