title: Splitting text in tab delimited format in python, adding it to list and writing it to a file... is there a better way?
body: <p>I'm new to scripting in python. I am extracting data from a tab delimited <code>vcf</code> file. My script works, but I have tried to concatenate the strings into a list using <code>word[0:2]</code> but this doesn`t work, so instead I add the data by splitting it manually:</p>
  
  <p>i.e: <code>word[0] + "\t" + word[1] + "\t" + word[2]</code> </p>
  
  <p>I am not sure why I have to do this as when I use <code>lst = word[0:2]</code> the command returns "can only concatenate list (not "str") to list. Why is this?</p>
  
  <p>My entire code is:</p>
  
  <pre><code>lst = []
  for line in my_file:
      if 'chr' in line:   
          word = line.split("\t")
          adp = word[7].split(";")
          pc = word[9].split(":")
          s = adp[0].split("=")
          lst = word[0] + "\t" + word[1] + "\t" + word[3] + "\t" + word[4] + "\t" + s[1] + "\t" + pc[6] + "\n"
          outputfile.write(lst)
  </code></pre>
  
  <p>How can I make this more concise?</p>
  
  <p>Thanks</p>