title: how to split a string in a for loop
body: <p>I have a list of strings that look like:</p>
  
  <pre><code>"Your friend Nicky thought you'd like this product from WorldStores",
  "Your friend Denise Holder thought you'd like this product from BedroomFurnitureWorld",
  </code></pre>
  
  <p>and so on</p>
  
  <p>I want to turn the list into just the last word of the sentence.
  my attempt so far has been:</p>
  
  <pre><code>test = []
  for i in sites:
      a = i.split('from ')
      a = a[1]
      test.append(a)
  </code></pre>
  
  <p>when I run this I get </p>
  
  <pre><code>a = a[1]
  
  IndexError: list index out of range
  </code></pre>
  
  <p>whereas when I do it individually for each string it works</p>
  
  <pre><code>In: a = i.split('from ')
  Out: ["Your friend Jack thought you'd like this product ", 'BedroomFurnitureWorld']
  
  In: a[1]
  Out: 'BedroomFurnitureWorld'
  </code></pre>
  
  <p>How can I do this in a for loop?</p>