Reputation: 79
I have this html email body and trying to put a loop to structure a list nicely.
item = (["<li>{}</li>".format(x) for x in list])
html = """\
<html>
<body>
<p>hi:<br>
<br>
""" + str(item) +"""
</p>
</body>
</html>
"""
The list:
['mango', 'peach', 'banana', 'apple']
Desired result in email:
mango
peach
banana
apple
Current result:
["
'
mango
', '
peach
', '
banana
', '
apple']
"]
Upvotes: 0
Views: 376