Sort and reverse elements in list : List Reverse « List « Python






Sort and reverse elements in list

Sort and reverse elements in list
scores = ["1","2","3"]

scores.sort()

for score in scores:
   print score


scores.reverse()        # want the highest number first


# list high-score table
for score in scores:
   print score

           
       








Related examples in the same category

1.List reverse(): Reverse the elements of the list, in placeList reverse(): Reverse the elements of the list, in place