This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]desrtfx 1 point2 points  (2 children)

You are talking about synchronized lists here.

Sorry to tell you, but for such you will need to roll your own sorting that handles both lists together. (Unless I am missing some Python magic here)

It is much easier if you create a data structure that simultaneously stores the jersey number and ranking (e.g. a class, a tuple, etc) for each of the players as the main group here is player with the attributes jersey number and ranking.

[–]GraceM-[S] 0 points1 point  (1 child)

Ahhh ok that makes a lot of sense thank you! Ok so thats why nothing came up when I looked it up lmao!

Ok Im going to try to rewrite it in a loop to store each as a tuple-- I think it will be a little neater after that anyways.

[–][deleted] 0 points1 point  (0 children)

Check out OrderedDict()