Sep-10-2021, 03:13 PM
(This post was last modified: Sep-10-2021, 03:16 PM by Yoriz.
Edit Reason: Added code tags
)
Hi,
I have a list of lists that I want to sort, something like :
Thanks
I have a list of lists that I want to sort, something like :
data = [[0,False,'c'], [0,True,'z'], [1,False,'P'], [0,True,'A']]I want all lists that have a True value at the top of Data, like :
sortingFuntion(data) = [[0,True,'z'], [0,True,'A'], [0,False,'c'], [1,False,'P']]I can access the boolean with
Data[i][1]
in a for loop but I can't come up with how to transmit that value as a criteria to sorted()Thanks