So a while ago I asked this question here: Sorting lists in python
I have this code here:
def sort(names, rank):
lst=[]
for x in range(0, len(names)):
lst.append((int(rank[x]), names[x]))
lst.sort(key=lambda x: (-x[0],len(x[1])) )
newArr = []
for z in range(0, len(lst)):
row = lst[z]
newArr.append(row[1] + " " + str(row[0]))
return newArr
But I also need to sort name more, if the length of the names are the same I need the one with the capital letter to come first. Any ideas?