>>> 'QH QD JC KD JS'.split()
['QH', 'QD', 'JC', 'KD', 'JS']
split:
Return a list of the words in the
string, usingsepas the delimiter
string. Ifmaxsplitis given, at most
maxsplitsplits are done (thus, the
list will have at mostmaxsplit+1
elements). Ifmaxsplitis not
specified, then there is no limit on
the number of splits (all possible
splits are made).If
sepis given, consecutive
delimiters are not grouped together
and are deemed to delimit empty
strings (for example,
'1,,2'.split(',')returns['1', '', '2']). Thesepargument may consist of
multiple characters (for example,
'1<>2<>3'.split('<>')returns['1', '2', '3']). Splitting an empty string
with a specified separator returns
[''].If
sepis not specified or isNone, a
different splitting algorithm is
applied: runs of consecutive
whitespace are regarded as a single
separator, and the result will contain
no empty strings at the start or end
if the string has leading or trailing
whitespace. Consequently, splitting an
empty string or a string consisting of
just whitespace with aNoneseparator
returns[].For example,
' 1 2 3 '.split()
returns['1', '2', '3'], and' 1 2 3 '.split(None, 1)returns['1', '2 3 '].