javascript coding - multiple inputs and outputs, and looking up outputs
<p>I am trying to code the following:</p>

<p>there will be six inputs, say 1,2,3,4,5,6</p>

<p>inputs 2-6 have two possible options (say yes and no)</p>

<p>input 1 has seven possible options (say a-g)</p>

<p>depending on which inputs are selected, a specific output will be generated.</p>

<p>So if you had -  a, yes, yes, no, no, no - it would generate outcome 'x'</p>

<p>I have managed to create a list with all the possible input combinations (using python):</p>

<pre><code>list = [[23,24,25,26,27,28,29],["male","female"],["true","false"],["true","false"],["true","false"],["true","false"]]

r=[[]]
for e in list:
    table = []
    for item in e:
            for i in r:
                table.append(i+[item])
    r = table

print r
</code></pre>

<p>My next stage is to allocate an outcome to each of these options.  I guess the best way to do this is just append the output to each list item so that</p>

<p>for e in index, if e[0]-e[5] matches the input then print out e[6]</p>

<p>Is this an ok way to do it?  </p>

<p><b>EDIT</b></p>

<p>Just to make it clearer I just thought I'd explain what I am actually trying to do. It's a free tool for doctors (I'm a doc - it's not for commercial purposes just to improve patient care).</p>

<p>It is a way of calculating risk for the patient, so there will be five questions the doc will input - e.g. male/female etc and depending on their inputs it will produce the outcome as a % risk for the patient. We are using years of previous patient outcome data to produce the table of outcome.</p>
