I created a 3-d array for storing info for a bowling team. I've organized it in my head as a directory with teams in it and those teams have profiles in them and the profiles include player name, team number, and score.
I created a test list to use:
test = [
[["John",1,153],["Lizzy",1,129],["Matt",1,178]],
[["Jorge",2,156],["Brent",2,145],["Kyle",2,207]],
[["Chuck",3,300]],
[["Joey",4,230],["Stanley",4,60]]
]
I want to create a sorted list of all the profiles by their score, and also another list by name alphabetically. I could do this with for loops but it would look a lot nicer just using the sorted()
. Is there a way to use the key parameter in the sorted()
function to do this?