So I'm trying to format a list in Python using the .format() method. I want my output to be as follows
One
Two
Three
Four
However, when I run the following code
if __name__ == '__main__':
output_str = ''
my_list = ['One', 'Two', 'Three', 'Four']
for element in my_list:
output_str = '{}{}\n\t'.format(output_str, element)
print (output_str)
It prints
One
Two
Three
Four
Is there a way of making new lines in Python while keeping all tabs made before with .format()? Thanks for answering :)