title: Iterating through a string word by word
body: <p>I wanted to know how to iterate through a string word by word.</p>
  <pre><code>string = &quot;this is a string&quot;
  for word in string:
      print (word)
  </code></pre>
  <p>The above gives an output:</p>
  <pre><code>t
  h
  i
  s
  
  i
  s
  
  a
  
  s
  t
  r
  i
  n
  g
  </code></pre>
  <p>But I am looking for the following output:</p>
  <pre class="lang-none prettyprint-override"><code>this
  is
  a
  string
  </code></pre>