Convert list of lists to delimited string
Like this, perhaps:
lists = [['dog', 1], ['cat', 2, 'a'], ['rat', 3, 4], ['bat', 5]]
result = "\n".join("\t".join(map(str,l)) for l in lists)
This joins all the inner lists using tabs, and concatenates the resulting list of strings using newlines.
It uses a feature called list comprehension to process the outer list.
# rows contains the list of lists
lines = []
for row in rows:
lines.append('\t'.join(map(str, row)))
result = '\n'.join(lines)