title: How to merge similar items in a list
body: <p>I haven't found anything relevant on Google, so I'm hoping to find some help here :)</p>
  
  <p>I've got a Python list as follows:  </p>
  
  <pre><code>[['hoose', 200], ["Bananphone", 10], ['House', 200], ["Bonerphone", 10], ['UniqueValue', 777] ...]
  </code></pre>
  
  <p>I have a function that returns the Levenshtein distance between 2 strings, for House and hoose it would return 2, etc.</p>
  
  <p>Now I want to merge list elements that have a levenshtein score of f.e. &lt;5, while (!) adding their scores, so for the resulting list I want the following:  </p>
  
  <pre><code>[['hoose', 400], ["Bananaphone", 20], ['UniqueValue', 777], ...]
  </code></pre>
  
  <p>or  </p>
  
  <pre><code>[['House', 400], ["Bonerphone", 20], ['UniqueValue', 777], ...]  
  </code></pre>
  
  <p>etc.</p>
  
  <p>It doesn't matter as long as their values get added.</p>
  
  <p>There will only ever be 2 items in the list that are very similar, so a chain effect of any one item similar to a lot of others eating them all up isn't expected. </p>