How to Join elements of an array in Python

Spread the love

Surprise that we are going to join elements of an array in Python, which is impossible to do because it is a PHP function we cannot run PHP functions in Python exactly. So, that’s why Python made its own built-in functions to use.

How to Join elements of an array in Python

list = ['Add', 'Wholeblogs', 'Answer']

Inline_joined = " ".join(list)

Add Wholeblogs Answer

pass_var = ", " joined = seperator.join(list)

print(pass_var)

Output

Add, Wholeblogs, Answer

 

Leave a Comment