我有以下元组,其中包含元组:
MY_TUPLE = ( ('A','Apple'), ('C','Carrot'), ('B','Banana'), )
我想根据内部元组中包含的第二个值来排序这个元组(即,排序Apple,Carrot,Banana而不是A,B,C).
有什么想法吗?
python sorting tuples
python ×1
sorting ×1
tuples ×1