Sorting two lists (a, b) according to a and returning back two sorted lists separately as exactly done below is correct.
a = ['apple','carrot','banana']
b = [5,10,15]
s = sorted(zip(a,b))
a,b = map(list, zip(*s))
print a
print b
['apple', 'banana', 'carrot']
[5, 15, 10]
But, any better ways to do this?
Given condition: Two lists, a and b.
Result: As printed above
PS This is Python 2.7