Understanding fragments of a Python/PuLP code
<p>I have to adopt an existing script where they used the PuLP package. I need to know how the result of the following line looks like:</p>

<pre><code>unit = ["one", "two", "three"]
time = range(10)

status=LpVariable.dicts("status",[(f,g) for f in unit for g in time],0,1,LpBinary)
</code></pre>

<p>How does the keys/values looks like?</p>

<pre><code>status["one"] = [0,1,1,1...]?
</code></pre>

<p>Thank you very much for your help!</p>

<pre><code>from pulp import *
unit = ["one", "two"]
time = range(2)

status=LpVariable.dicts("status",[(f,g) for f in unit for g in time],0,1,LpBinary)
</code></pre>

<p>Leads to </p>

<pre><code>&gt;&gt;&gt; status

{('two', 1): status_('two',_1), 
('two', 2): status_('two',_2), 
('one', 2): status_('one',_2), 
('one', 0): status_('one',_0), 
('one', 1): status_('one',_1), 
('two', 0): status_('two',_0)}
</code></pre>

<p>So, there is no entry with the key "one".</p>

python pulp