I have a list (23 items) of choices and I've transformed it into a dictionary in order to have a value for each choice.
I need to select 3 random choices from that dictionary each time I run the test and their value sum has to be 23.
Until now I did this:
list = ['somthing', 'something else'......'something else else'] nums = [1,2,3...23] dic = dict(zip(lista, nums)) for x, y, z in dic: if dic.values(x) + dic.values(y) + dic.values(z) == 23: print(x, y, z)
and I get that there are too many values to unpack.
Any idea how I can get this done?