title: Renaming multiple sub folders to match the parent folder's name
body: <p>I'm a python beginner but have some basic experience, and I need someone to please help me use the os module to rename sub folders based on their parent folder.  I've been searching for answers for the past week and have not had any success.  I'm assuming I need to use the os.walk method to do this.  </p>
  
  <p>Here is my folder structure:</p>
  
  <ul>
  <li>C:\data\test\
  
  <ul>
  <li>C:\data\test\map1
  
  <ul>
  <li>C:\data\test\map1\1617151</li>
  </ul></li>
  <li>C:\data\test\map2
  
  <ul>
  <li>C:\data\test\map2\181719</li>
  </ul></li>
  <li>C:\data\test\map3
  
  <ul>
  <li>C:\data\test\map3\182726</li>
  </ul></li>
  <li>C:\data\test\map4
  
  <ul>
  <li>C:\data\test\map4\894932</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>I need the results to look like this.</p>
  
  <ul>
  <li>C:\data\test\
  
  <ul>
  <li>C:\data\test\map1
  
  <ul>
  <li>C:\data\test\map1\map1</li>
  </ul></li>
  <li>C:\data\test\map2
  
  <ul>
  <li>C:\data\test\map2\map2</li>
  </ul></li>
  <li>C:\data\test\map3
  
  <ul>
  <li>C:\data\test\map3\map3</li>
  </ul></li>
  <li>C:\data\test\map4
  
  <ul>
  <li>C:\data\test\map4\map4</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Can someone please help?</p>