Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sort_list_a_by_list_b.py
- X = ["t", "n", "h", "!", "y", "P", "o"]
- Y = [ 3, 6, 4, 7, 2, 1, 5 ]
- print ''.join([x for (y,x) in sorted(zip(Y,X), key=lambda pair: pair[0])])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement