How to print list of string in one line in Python Flask

Solution 1
pitch_dataset_string = ', '.join(pitch_dataset)
{{ pitch_dataset_string }}
Solution 2
{% for i in pitch_dataset %} {{ i }}{% if not loop.last %}, {% endif %} {% endfor %}