View Single Post
Old 01-28-2018, 12:20 PM   #5
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Thanks.

The code above didn't quite work (something about not being iterable) but managed to get the function working with the ff:

Code:
    # sort John/Jane to Jane/John
    separator = '/'
    tmplist = []
    for list1 in val:
        res = [l.strip() for l in list1.split(separator)]
        tmplist.append( separator.join(sorted(res)) )

    val = tmplist
ilovejedd is offline   Reply With Quote