In the code
list1=['my data items1', 'my data items2','my data items3']
When I do
str1=''
for i in list1:
str1=str1+i+'\n'
I get str1='my data items1\nmy data items2\nmy data items3'
I want str1
to be a multiline string but it seems there is no way to do that without using print
statement or is there a way?
I expected a multiline string but not getting one without using print. I need to send this list as email body so need a variable assigned to a string variable.