Sort elements in a list : List Sort : List PYTHON examples


PYTHON examples » List » List Sort »

 

Sort elements in a list


Sort elements in a list
 

L = ['spam', 'Spam', 'SPAM!']

print L.append('please')                # append method call
print L

L.sort()                          # sort list items ('S' 'e')
print L

           
         
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo List
» List Sort