0

I have a mission to create function that you put her 2 tupels and it create you all the combination that can be done. I tried to create function and but if I wright return so I get one argument back and if I wright print so I get the two argument printed, hoe I get two of them back and put them into list? and in general how I need to wright the function, I will love to see example. that is my try to wright it and it very not good

def mult_tuple(tuple1, tuple2):
    list=[]
    new_list = []
    for i in tuple1:
        print(i)
    for n in tuple2:
            mew_list = new_list[i , n]
            return i
    return list
    list.append(new_list)
    return list

print(mult_tuple((1, 4), (5,6)))
  • Can you provide an example? Probably the answer is `itertools.combinations`. – erip Nov 21 '22 at 13:20
  • As an aside, don't name a variable `list` because it will shadow the existing list built-in in python. I'm not sure your code as written makes any sense either--are sure what you pasted is how it is written in your editor? – Iguananaut Nov 21 '22 at 13:23

0 Answers0