I have two variables:
unique_val = [1,2,3] nested_list = [[\'name1\',1],[\'name2\',1],[\'name3\',3],[\'name4\',2],[\'name5\',2],[\'name6\',3]]
you can use list comprehension:
[[name for name, number in nested_list if number == n] for n in unique_val]
if you really want to put it in separate variable, you can do the following.
list_1, list_2, list_3 = [[name for name, number in nested_list if number == n] for n in unique_val]