Suppose that we have a list such:
our_list = [1, 4, 5, 8]
Using ”, ”.join(our_list) will not work because join expects strings and not integers.
TypeError: sequence item 0: expected string, int found
Solution:
", ".join([str(elem) for elem in our_list])
or even easier (and more pythonic) :P
", ".join(map(str, our_list))