title: Python: Get name of list as string
body: <p>I have a program in python similar to:</p>
  
  <pre><code>from collections import defaultdict
  
  d = defaultdict(list)
  L = ['A', 'B', 'C']
  
  for l in L:
      d[l].append('')
  </code></pre>
  
  <p>In my actual program I populate each sublist with somedata, but then I would like to go over each list individually and perform some action. I can get all of it working, but in an effort to write an ouptut for part of the loop I would like to print the name of the sublist I am working with.</p>
  
  <p>For instance:</p>
  
  <pre><code>for List in d:
      print str(List)
  </code></pre>
  
  <p>of course this is wrong and will just print the content of the list as a string. I want to get the name of the string so my output would be:</p>
  
  <pre><code>'A'
  'B'
  'C'
  </code></pre>