title: For loop in python to check elements in list
body: <p>I have this code:</p>
  
  <pre><code>keys = ['well done','come on','going to','c','D','m','l','o']
  values = ['well','going','come','D']
  category = []
  for index, i in enumerate(keys):
      for j in values:
          if j in i:
              category.append(j)
              break
          if index == len(category):
              category.append("other")
  print(category)
  </code></pre>
  
  <p>I am getting this output <code>['well', 'other', 'come', 'going', 'other', 'D', 'other', 'other']</code></p>
  
  <p>The expected output is <code>['well', 'come', 'going', 'other', 'D', 'other','other' 'other']</code></p>
  
  <p>I'm not sure what's wrong with the code.</p>
  
  <p>Any help would be appreciated.</p>