This is slightly different than most of the sorting questions on here and I haven't been able to figure out how to get this to work. I have 3 lists, and 2 of them I need to match the order of the 3rd list. There are integers in list 2 that correspond to the same indexed word in list 1. If there is an item in the 3rd list not in the other two i need to generate random numbers for it. The third list is also a tuple, but it's sorted so not sure that will matter. if a word is in lists are in 1 and 2 but not in 3 we can drop those.
For example:
import random
List1 = ['test', 'list', '1']
list2 = [[1,2,3], [4,5,6], [1,3,5]
list3 = [('this', 1),('is',2),('a',3),('test',4),('list',5)]
what I'd like the results to be is
list1 = ['this', 'is', 'a' , 'test', 'list'] (just equal to first item in list 3)
list2 = [random((1,4),3), random((1,4),3), random((1,4),3), [1,2,3],[4,5,6]]