I want to sort the array c. But I don't get the answer a,b,c,d. Instead I get a,b,d,c. What could I do, for sorting the whole array and not only one row?
EDIT: I want to sort the numbers. And the connected letters, should have the same order like the sorted numbers. sorry my question wasn't clear. Maybe I should join number and letters first. Like this:
[['a',1]['b',2]….
a = ['a','b','d','c']
b = [1,2,4,3]
c = [[],[]]
c[0]=a
c[1]=b
c[1].sort()
print(c)
Best Answer