title: Is there a way to save multiple variables in python pickle?
body: <p>I am trying to save multiple variables to a file. E.G saving an item in a shop so I'm trying to save the items price,name and code to one file, and multiple items to the same file</p>
  
  <pre><code>def enter_item_info():
  count = 0
  count1 = 0
  print("how many items are you entering?")
  amount = int(input("Items = "))
  data = [[0,1,2]] * amount
  
  
  
  
  file = (open('fruit.txt','wb'))
  while count &lt; amount:
  
  
  
  
      data[0 + count1][0] = input("Code")
  
  
      data[0 + count1][1] = input("NAme")
  
      data[0 + count1][2] = input("Price")
      count1 = count1 + 1
      count = count + 1
  
  
      print("")
  
  
  
  pickle.dump(data , file)
  file.close()
  amount = str(amount)
  file1 = (open('amount.txt','wb'))
  pickle.dump(amount , file1)
  file1.close()
  </code></pre>