tags:

views:

91

answers:

1

I'm looking for the best way to write a function that takes a string in the form:

"First" "First Last" "First Middle Last" "First M. Last" "First Second Third Last"

And can return a python a list with each of the values separated.

Thanks.

+4  A: 

Use the split function:

>>> s = "First Middle Last"
>>> s.split(" ")
['First', 'Middle', 'Last']
Andrew Hare
Easy enough. thanks.
ensnare