Reputation: 11
What I want my answer to look like: Hello World
Notice that it is not a string so it does not have apostrophes around it
m = 'Hello World'
w = m.split()
for final in w:
(final = ??, end = ' ')
Hello World
The code i want looks very similar to this, I just forgot what to put for final and end
Upvotes: 0
Views: 58
Reputation: 20196
I'm not sure what the question is, but I'll at least say something relevant.
>>> m = 'Hello World'
>>> w = m.split()
>>> n = ' '.join(w)
>>> print(n)
Hello World
Here, 'Hello World'
is split on the spaces, so you just have to join the pieces with spaces.
Upvotes: 5