aclewett

ScoresSort

Apr 10th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. scores = '54 - Alice,35 - Bob,27 - Carol,27 - Chuck,05 - Craig,30 - Dan,27 - Erin,77 - Eve,14 - Fay,20 - Frank,48 - Grace,61 - Heidi,03 - Judy,28 - Mallory,05 - Olivia,44 - Oscar,34 - Peggy,30 - Sybil,82 - Trent,75 - Trudy,92 - Victor,37 - Walter'
  2. list_of_scores = scores.split(',')
  3. print(list_of_scores)
  4. list_of_scores.sort()
  5. print(list_of_scores)
  6. list_of_scores.reverse()
  7. print(list_of_scores)
Advertisement
Add Comment
Please, Sign In to add comment