Efficient way to add spaces between characters in a string

python, string

Solution

s = "BINGO"
print(" ".join(s))

Should do it.

Problem

Say I have a string `s = 'BINGO'`; I want to iterate over the string to produce `'B I N G O'`. This is what I did: ``` result = '' for ch in s: result = result + ch + ' ' print(result[:-1]) # to rid of space after O ``` Is there a more efficient way to go about this?

Original source