這個網誌中的熱門文章
Python: character sort
Python-character sort In [2]: aa = [ 'letter' , 'High' , 'good' , 'Mon' , 'apple' , 'Banana' , 'tomorro' , 'tomato' ] In [3]: aa . sort () In [4]: aa Out[4]: ['Banana', 'High', 'Mon', 'apple', 'good', 'letter', 'tomato', 'tomorro'] In [5]: aa . sort ( key = str . lower ) In [6]: aa Out[6]: ['apple', 'Banana', 'good', 'High', 'letter', 'Mon', 'tomato', 'tomorro']