Python Forum
Need help with sorting lists as a beginner
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with sorting lists as a beginner
#1
I am trying to sort scores from a list that was put into a text file and then transferred into another list. I have tried two methods (shown below) but both of them seem to sort by the first digit of the number, similar to as if it was a decimal number. How can I fix this to sort the list by the full value of the numbers rather than just the first digit?
Code:
   
Output:
   
Reply


Messages In This Thread
Need help with sorting lists as a beginner - by Realist1c - Apr-25-2023, 03:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  sorting a list of lists by an element leapcfm 3 1,945 Sep-10-2021, 03:33 PM
Last Post: leapcfm
  beginner question about lists and functions sudonym3 5 2,825 Oct-17-2020, 12:31 AM
Last Post: perfringo
  Split dict of lists into smaller dicts of lists. pcs3rd 3 2,459 Sep-19-2020, 09:12 AM
Last Post: ibreeden
  sorting list of lists pframe 5 26,613 Apr-17-2020, 09:31 PM
Last Post: Larz60+
  Beginner. Help needed in sorting sundaeli 4 2,267 Mar-21-2020, 07:16 PM
Last Post: sundaeli
  Sorting a copied list is also sorting the original list ? SN_YAZER 3 3,137 Apr-11-2019, 05:10 PM
Last Post: SN_YAZER
  sort lists of lists with multiple criteria: similar values need to be treated equal stillsen 2 3,328 Mar-20-2019, 08:01 PM
Last Post: stillsen
  Sorting lists prioritizing letters before numbers Ratherfastmofo 5 3,293 Nov-21-2018, 06:44 PM
Last Post: woooee
  Sorting list of lists with string and int Otbredbaron 6 4,260 May-07-2018, 06:04 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020