---
title: "str.join"
space: "Student Handbook"
url: "https://portal.cs17.org/student-handbook/python-manual/strings/join"
updated: "2026-10-05"
---

Joins a list of strings into one string.

## Synopsis

```python
separator.join(list)
```

## Description

The string before the dot goes between the items. `join` is the opposite of `split`.

## Parameters

| Name | Meaning |
| --- | --- |
| `list` | A list of strings. |

## Return value

A `str`.

## Example

```python
colours = ["red", "green", "blue"]
print(", ".join(colours))
print("".join(["a", "b", "c"]))
print("-".join("abc"))
```

It prints:

```text
red, green, blue
abc
a-b-c
```

## Common mistake

```python
print(", ".join([1, 2, 3]))
```

Python stops with:

```text
TypeError: sequence item 0: expected str instance, int found
```

Every item must be a string. Store them as strings (`["1", "2", "3"]`), or build the text with an f-string.

## See also

[str.split](/student-handbook/python-manual/strings/split), [sum](/student-handbook/python-manual/built-in-functions/sum)

[str.join in the Python documentation](https://docs.python.org/3/library/stdtypes.html#str.join)
