How to Join a List into a String in Python
· 1 min read · Updated March 17, 2026 · beginner
python strings lists beginner
Joining a List of Strings
The str.join() method is the standard way to combine list elements into a single string.
words = ["hello", "world", "python"]
result = " ".join(words)
print(result) # hello world python
Using Different Separators
You can use any string as a separator:
words = ["apple", "banana", "cherry"]
print(", ".join(words)) # apple, banana, cherry
print("-".join(words)) # apple-banana-cherry
print("".join(words)) # applebananacherry
Joining a List of Numbers
Numbers must be converted to strings first:
numbers = [1, 2, 3, 4, 5]
# Using map() to convert to strings
result = "-".join(map(str, numbers))
print(result) # 1-2-3-4-5
# Using list comprehension
result = ":".join([str(n) for n in numbers])
print(result) # 1:2:3:4:5
Practical Example
path_parts = ["home", "user", "documents", "file.txt"]
full_path = "/".join(path_parts)
print(full_path) # home/user/documents/file.txt
The join() method is efficient and works with any iterable containing strings.