join()

A string method that glues a list of strings together with the string it is called on between them.

In more detail

", ".join(["a", "b", "c"]) gives "a, b, c". It is roughly the reverse of split. Every item must already be a string, so convert numbers first, for example with a comprehension.

Example

"-".join(["2026", "09", "29"])

Related terms

Taught in

References

Certification courses