So, I have a project in which I have a list of strings:
outputs = ['cow', 'chicken', 'pig']
I need to turn them into a string, with each value separated by a newline, like so:
cow
chicken
pig
I found a solution at python list to newline separated value, but it uses a list like this:
outputs = [['cow'], ['chicken'], ['pig']]
and whenever I run:
answer = "\n".join(map(lambda x: x[0], outputs))
print(answer)
It returns 'c'
, as is the case with all the other answers in that question.