So then there's all this fuss about checking whether the item is last in the list and not slot in a comma, but oh wait! what if the list is empty, blah blah blah.
Python makes it easy -- use a join:
', '.join(list)
Done; finished; end of story.
I love Python ...
No comments:
Post a Comment