In C#, if I have a collection of strings, and I want to get a comma-separated string representing of the collection (without extraneous comments at the beginning or end), I can do this:
string result = collection.Aggregate((s1, s2) => String.Format("{0}, {1}", s1, s2));
I could do something like
result = collection[0]
for string in collection[1:]:
result = "{0}, {1}".format(result, string)
But this feels like a cludge. Does python have an elegant way to accomplish the same thing?