How do I create lists out of dictionary, having same name as dictionary keys and same size as value of that key?
<p>In Python, Suppose there is a dictionary named fruits:</p>

<pre><code>fruits={
"apple":5,
"orange":7,
"mango":9
}
</code></pre>

<p>On reading the dictionary items, it should create 3 lists having same name as dictionary keys viz. apple, orange and mango and size of theses lists should be 5, 7 and 9 respectively.
The elements of these lists should be given from the user through console.</p>

<pre><code>d = { "apple":5, "orange":7, "mango":9 }
for k in d:
    temp = []
    for k2 in range(0,d[k]):
        print "enter the next "+str(k)+":"
        temp.append(raw_input())
    exec(str(k)+"="+str(temp))
</code></pre>

<p>but don't.
<a href="http://stackoverflow.com/questions/8818318/how-to-eval-a-string-containing-an-equal-symbol">How to eval a string containing an equal symbol?</a></p>

python list python-3.x dictionary