#list = [ ["1 NWZ", "1 RWZ", "2 NWZ", "2 RWZ", "1E HZ", "1W HZ", "1-2EHZ", 2.0, "2W HZ", etc...] #^ #["1 NWZ", "1W HZ", "3E FZ", "SNOK", "POK", 4.0, "1-2EHZ", "2E AK", "2W HZ", etc...] #^ #["1 BW", "1AW AS"K, "3E FZ", "1BWAK", "POK", "TESTK", "1-2EHZ", "2E AK", 1.0, etc...] ] #^ listed = [ ["1 NWZ", "1 RWZ", "2 NWZ", "2 RWZ", "1E HZ", "1W HZ", "1-2EHZ", 2.0, "2W HZ"], ["1 NWZ", "1W HZ", "3E FZ", "SNOK", "POK", 3.0, "1-2EHZ", "2E AK", "2W HZ"], ["1 BW", "1AW AS", "3E FZ", "1BWAK", "POK", "TESTK", "1-2EHZ", "2E AK", 1.0]] dictionary={} for sub_list in listed: for value in sub_list: if isinstance(value,float): dictionary[str(value)]=sub_list else: pass ordered_list=[] for i in range(1,len(listed)+1): if dictionary[str(i)]: ordered_list.append(dictionary[str(i)]) for sub_list in ordered_list: print sub_list