> > ['3zxc','21 trewuuioi','134445'] > > > rather than ['134445', '21 trewuuioi', '3zxc']? > > > > > > Any help would be greatly appreciated > > > Pete > > There seem to be two different ways of understand the OP sort order. >
The way I took it, 3zxc comes first because the number is 3 which is smaller than 21 which is smaller than 134445. It happened to be a coincidence that the list reversed was in that same order. So, if I am right about the definition of how to sort, the method I would use is to strip each string of anything beyond its leading digits, save that as a key, use the string as the value. Then sort by key -- Joel Goldstick
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor