title: Recursive Huffman Coding in Python
body: <p>I was asked to create functions in Python WITHOUT using loops and trees to represent Huffman Coding. I created function which from this input:</p>
  
  <pre><code>[('a',4),('b',10),('c',15),('d',18),('e',42),('f',11)]
  </code></pre>
  
  <p>gives this output:</p>
  
  <pre><code>('e', (('f', ('a', 'b')), ('c', 'd')))
  </code></pre>
  
  <p>Now, I am supposed to create function which encodes this output into</p>
  
  <pre><code>[('e','0' ) , ('f','100') , ('a', '1010') , ( 'b' , '1011' ) , ('c', '110') , ('d','111' ) ]
  </code></pre>
  
  <p>I have no idea how to (without using loops) change tuple to list and in the same time adding <code>1</code> and <code>0</code> to certain elements.</p>