Join & Split
PY · Stringssyntax
separator.join(iterable)
str.split(separator)example
words = ["Python", "is", "great"]
sentence = " ".join(words)
print(sentence)
csv_row = "alice,30,engineer"
fields = csv_row.split(",")
print(fields)output
Python is great
['alice', '30', 'engineer']Note split() with no arguments splits on any whitespace and removes empty strings. split(',') keeps empty strings between consecutive delimiters.