Dec-17-2020, 06:01 PM
Actually, this won't work with x + anything greater than 1. So, I should have just hard coded the numbers in there, As such:
list1 = [30, 50, 110, 40, 15, 75] list2 = [10, 60, 20, 50, 80] list3 = [59, 68, 20, 78, 98] sum_list = [(n1, n2, n3) for n1 in list1 for n2 in list2 for n3 in list3 if n1 + n2 + n3 > 100] for index, value in enumerate(sum_list): for x in range(len(value) - 1): print(value[x], value[1], value[2])