Python iterate over a dictionary
<pre><code>In [26]: test = {}

In [27]: test["apple"] = "green"

In [28]: test["banana"] = "yellow"

In [29]: test["orange"] = "orange"

In [32]: for fruit, colour in test:
   ....:     print fruit
   ....:     
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home1/users/joe.borg/&lt;ipython-input-32-8930fa4ae2ac&gt; in &lt;module&gt;()
----&gt; 1 for fruit, colour in test:
      2     print fruit
      3 

ValueError: too many values to unpack
</code></pre>

<p>What I want is to iterate over test and get the key and value together.  If I just do a <code>for item in test:</code> I get the key only.</p>

<p>An example of the end goal would be:</p>

<pre><code>for fruit, colour in test:
    print "The fruit %s is the colour %s" % (fruit, colour)
</code></pre>
