strings and sort()

Jason caljason76 at yahoo.com
Wed Feb 20 20:35:34 EST 2002


How do I sort the characters in a string, so far I use this:
        a="qwerasdfzxcv"
        b=[x for x in a]
        b.sort()

Why doesn't sort() return the sorted list.  I would like to chain it
to other operations:
        b=[x for x in a].sort()

-j



More information about the Python-list mailing list