[EMAIL PROTECTED] a écrit : > hi, > > I have the following list - > > ["1", "11", "2", "22"] > > how do I sort it like this - > > ["1", "2", "11", "22"]
source = ["1", "11", "2", "22"] result = [t[1] for t in sorted((int(item), item) for item in source)] print result -- http://mail.python.org/mailman/listinfo/python-list