0

In Python, when we use split(), the syntax looks like this:

list_result = string.split(separator)

But when we use join(), it's written like this:

string_result = separator.join(list_of_strings)

Why is the format different? Why don't we write join() like this instead?

list_of_strings.join(separator)

Is it just a design choice made by Python's creators, or is there a deeper reason why join() can’t follow the same pattern as split()?

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.