join()

say it: “JOYN” /dʒɔɪn/

Glues a list of strings into one string with a separator between them.

What does join() do?

join() glues a list of strings into one string, with the separator you choose between them.

toppings = ["cheese", "peppers", "onions"]
print(", ".join(toppings))  # cheese, peppers, onions

Level: Apprentice · More Python terms at this level

Updated

In other subjects