24

I'm super new to any sort of programming, so forgive my ignorance for not knowing how to do something that seems so simple.

All I'd like to do is take any array of strings (call it name), let's say:

["John", "Charles", "Smith"]

and remove it from the list and turn it into a string:

John Charles Smith

I can't seem to get my head around this and couldn't find a similar post.

0

1 Answer 1

57

Just use:

" ".join(["John", "Charles", "Smith"])
Sign up to request clarification or add additional context in comments.

2 Comments

I had actually tried that, but for some reason I was getting back the strings still in a list but now with a space, i.e. ["John Charles Smith"]. I made a small adjustment however and this time it worked. Thanks!
What was that small adjustment you made @cccg03?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.