我创建了以下
class uniquePlayers():
def __init__(self):
self._item = [ [] for i in range(5) ]
self.count = 0
def addPlayer(self, firstInstance, firstName, lastName, Country, long):
self._item[0].append(firstInstance)
self._item[1].append(firstName.lower())
self._item[2].append(lastName.lower())
self._item[3].append(Country)
self._item[4].append(long.lower())
self.count += 1
def sortByKey(self, index = 4 ):
self._item[index].sort()
我正在尝试对整个班级进行排序,并保留其他列表中的所有内容。显然我所做的只是对“长”列表进行排序