ketulp_baroda at yahoo.com wrote: > Hi> I want to sort a list.> My problem is:> > >>>>a=['a','f','F','A','D']>>>>a.sort()>>>>a> > ['A','D', 'F', 'a', 'f']> > > But I am actually looking for an output:> ['A','a','D','F','f']> > Is there any module to sort a list this way? If you want to sort textual data sensitive to the current user's language do this: a=['a','f','F','A','D'] import locale locale.setlocale(locale.LC_ALL,"") a.sort(locale.strcoll) -- P?draig Brady - http://www.pixelbeat.org
Recent Messages in this Thread | ||
---|---|---|