Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Why is it not: 5wlfgALGbXOahekxSs9wlfgALGbXOahekxSs5wlfgALGbXOahekxSs ? With the string appended to the last element? Commented Dec 9, 2009 at 19:27
  • 12
    One reason is this gives join the useful property of being the inverse of split (docs.python.org/library/stdtypes.html#str.split) Commented Dec 9, 2009 at 19:31
  • 4
    If you want another delimiter, put an empty string at the end of your list. ','.join(['a', 'b', 'c', '']) gives "a,b,c," Commented Dec 9, 2009 at 19:31
  • 9
    OP was probably confusing string.join with os.path.join which indeed concatenates paths Commented Jan 28, 2014 at 17:33