title: Is there a way to keep indexing nested dictionaries until you find a string value?
body: <p>I'm working with a dict. It has some nested dicts. It looks like this:</p>
  
  <p>As you can see, <code>education</code> and <code>experience</code> have nested dicts. <code>skills</code>, <code>industry</code> and <code>summary</code> are just keys with values.</p>
  
  <pre><code>{
    "education": [
      {
        "start": "1991",
        "major": "Human Resources"
      },
      {
        "start": "1984",
        "major": "Chemistry"
      }
    ],
    "skills": [
      "AML",
      "Relationship Management",
      "Team Management"
    ],
    "industry": "Banking",
    "experience": [
      {
        "org": "Standard Chartered Bank",
        "desc": "text"
      },
      {
        "org": "Tesa Tapes India Pvt. Ltd.",
        "desc": "text",
        "start": "October 1993",
        "title": "Product Manager/Application Engineer"
      }
    ],
    "summary": "text blah blah blah"
  }
  </code></pre>
  
  <p>I need to access all the values corresponding to keys <code>start</code>, <code>major</code>, the list of strings from <code>skills</code>, <code>industry</code>, <code>org</code>, <code>desc</code> and <code>summary</code>, so that I can modify the strings.</p>
  
  <p>So is there some way of accessing the values like this:</p>
  
  <pre><code>for keys in outerDict.keys():
      if outerDict[keys] has a nested dict:
          for keys in nestedDict.keys():
              nestedDict[keys] = doStuffToString(nestedDict[keys])
      else:
          outerDict[keys] = doStuffToString(outerDict[keys])
  </code></pre>
  
  <p>In other words, keep indexing the nested dicts (if they exist) until you find a string value.</p>
  
  <p>An even better answer might handle the general case: variable number of dicts nested inside of other dicts. Perhaps there are nested dicts going several layers deep (dicts inside of dicts inside of dicts inside of dicts...until eventually you hit some strings/integers).</p>