Skip to content
Advertisement

How to turn a list/tuple into a space separated string in python using a single line?

I tried doing:

JavaScript

but it says str object is not callable. Is this doable using a single line?

Advertisement

Answer

Use string join() method.

List:

JavaScript

Tuple:

JavaScript

Non-string objects:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement