title: Accessing nested dictionary items in Python
body: <p>I am trying to format a string using an item from a nested dictionary (below)</p>
  
  <pre><code>    people = {
          'Alice': {
              'phone': '2341',
              'addr': '87 Eastlake Court'
              },
  
          'Beth': {
              'phone': '9102',
              'addr': '563 Hartford Drive'
              },
  
          'Randy': {
              'phone': '4563',
              'addr': '93 SW 43rd'
              }
  
          }
  </code></pre>
  
  <p>From the above (simple) dictionary, I want to format a string to print out Randy's phone extension.</p>
  
  <p>I am able to access all of his details using:</p>
  
  <pre><code>    print("Randy's phone # is %(Randy)s" % people)
  </code></pre>
  
  <p>But I'm not sure on how to go deeper into the dictionary to single out just the phone number from the dictionary.</p>
  
  <p>I am using Python 3.3, by the way.</p>