title: Print Keys of nested dictionaries in sorted order in Python
body: <p>I am learning a bit of Python at the moment. One of the first tasks I face is to print the keys of a dictionary and its possible nested dictionaries in sorted order.</p>
  
  <p>The task definition is:</p>
  
  <blockquote>
    <p>Write a program to display all the keys of a 'dictionary of dictionaries' (nested dictionary) in sorted order</p>
  </blockquote>
  
  <p>So I have something like</p>
  
  <pre><code>vDict={1:2942, 5:{20:231, 49:359, 65:429}, 39:{9359:2932, 9298:29328, 124:4}}
  </code></pre>
  
  <p>and need to print all of its keys in sorted order.
  Theoretically, I am not aware of modules so I can only use built in functions</p>
  
  <p>In my mind, the only way I can come up with is to use the output of <code>vDict.keys()</code> function and split with regex in order to sort the values. But then I have no idea how to iterate through tier 2 dictionaries.</p>
  
  <p>I am pretty sure that is not what I am supposed to do here and there is an easier way. I would be interested to see how an educated mind approaches this.</p>
  
  <p>This is a self study during calm work hours so you are not doing my homework here ;)</p>