sort list doesnt work, key=str still doesnt work

Dan Bishop danb_83 at yahoo.com
Mon May 26 22:51:48 EDT 2008


On May 26, 9:46 pm, notnorweg... at yahoo.se wrote:
> >>> x
>
> [',', ',', 'CHAPTER', 'Emma', 'I', 'I', 'VOLUME', 'Woodhouse',
> 'clever', 'handsome']>>> x=sorted([',', ',', 'CHAPTER', 'Emma', 'I', 'I', 'VOLUME', 'Woodhouse', 'clever', 'handsome'], key=str)
> >>> x
>
> [',', ',', 'CHAPTER', 'Emma', 'I', 'I', 'VOLUME', 'Woodhouse',
> 'clever', 'handsome']
>
>
>
> what do i need to do?

x.sort(key=str.upper)



More information about the Python-list mailing list