a = [['UK', 'FR', 0.021], ['UK', 'NL', 0.094], ['UK', 'PT', 0.034]] print(a) a.sort(key=lambda l: l[2], reverse=True) print(a)
Standard input is empty
[['UK', 'FR', 0.021], ['UK', 'NL', 0.094], ['UK', 'PT', 0.034]] [['UK', 'NL', 0.094], ['UK', 'PT', 0.034], ['UK', 'FR', 0.021]]