Zip a
and b
on their own, write that line, then write c
on the next:
ofile.write('\t'.join(['{}-{}'.format(*pair) for pair in zip(a, b)]) + '\n')
ofile.write('\t'.join(map(str, c)) + '\n')
This uses str.join()
to put tabs between the values on a line.
It'd be easier to use the csv
module to take care of turning values into strings and to write tabs and line separators:
writer = csv.writer(ofile, delimiter='\t')
writer.writerow(['{}-{}'.format(*pair) for pair in zip(a b)])
writer.writerow(c)