String Splitter Brain Teaser

runsun pan runsun at gmail.com
Mon Mar 28 05:04:10 EST 2005


For the fans of funtional programming:

>>> s='ATT/GATA/G'
>>> [y.split('/') for y in (' '.join([x for x in s]).replace(' / ',
'/')).split()]
[['A'], ['T'], ['T', 'G'], ['A'], ['T'], ['A', 'G']]




More information about the Python-list mailing list