title: Finding differences between strings
body: <p>I have the following function that gets a source and a modified strings, and bolds the changed words in it.</p>
  
  <pre><code>def appendBoldChanges(s1, s2):
      "Adds &lt;b&gt;&lt;/b&gt; tags to words that are changed"
      l1 = s1.split(' ')
      l2 = s2.split(' ')
      for i, val in enumerate(l1):
          if l1[i].lower() != l2[i].lower():
              s2 = s2.replace(l2[i], "&lt;b&gt;%s&lt;/b&gt;" % l2[i])
  
      return s2
  print appendBoldChanges("britney spirs", "britney spears") # returns britney &lt;b&gt;spears&lt;/b&gt;
  </code></pre>
  
  <p>It works fine on strings with the same word count, but fails with different word counts, as <code>sora iro days</code> and <code>sorairo days</code>.</p>
  
  <p>How can I take the spaced into consideration?</p>