How to convert a list of longs into a comma separated string in python
python
Solution
You have to convert the ints to strings and then you can join them:
','.join([str(i) for i in list_of_ints])
Problem
I'm new to python, and have a list of longs which I want to join together into a comma separated string. In PHP I'd do something like this: ``` $output = implode(",", $array) ``` In Python, I'm not sure how to do this. I've tried using join, but this doesn't work since the elements are the wrong type (i.e., not strings). Do I need to create a copy of the list and convert each element in the copy from a long into a string? Or is there a simpler way to do it?