I have two lists
A = ["ATTTGTA", "ATTTGTA", "ATTTGTA", "ATTTGTA"]
A_modified = ["ATTGTA", "AAAT", "TTTA"]
I want an output tab separated txt file looking like
ATTTGTA ATTGTA
ATTTGTA AAAT
ATTTGTA TTTA
I tried the following piece of code but it does not write o/p in two columns, just as new rows each time
with open ('processed_seq.txt','a') as proc_seqf:
proc_seqf.write(A)
proc_seqf.write("\t")
proc_seqf.write(A_modified)
This is the output I get
ATTTGTA
ATTGTA
ATTTGTA
AAAT
ATTTGTA
TTTA
csvmodule.proc_seqf.write("%s\t%s" % (A, A_modified))might also work as a replacement for all of yourwrite()lines, but usingzipis probably the best way to get it organized in a meaningful way first, then follow mihai's answer