title: Python - Print only words with less than five characters
body: <p>This question is related to my education, with that said I wish to have any help you provide me with as detailed as possible - I dont want to copy-paste code and hand it in. :)</p>
  
  <p>The task is simple - Create a definition called writeshort(txt), take a string of words, print only words that have less than five characters. Now I have completed this, but the thing is that the task specifically sais use a <em>definition</em>. I fail here.</p>
  
  <p>Code without a definition, that works:</p>
  
  <pre><code>#!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  
  string = raw_input(”Write a few lines: ”)
  txt = string.split()
  result = []
  
  for words in txt:
      if len(words) &gt; 4:
          continue
      result.append(words)
  
  print ', '.join(result), ”have less than five letters!”
  </code></pre>
  
  <p>Now that looks nice, and prints without any nasty [' ']. But what about the definitions?
  I've tried several things, this is the lastest, but it only prints the first word with less than five letters, and ignores the rest:</p>
  
  <pre><code>#!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  
  string = raw_input(”Write a few lines: ”)
  txt = string.split()
  
  def writeshort(txt):
      for txt in txt:
          if len(txt) &gt; 4: #Yes I know its a 4, but since it counts 0...
              continue
          return txt
  
  print writeshort(txt), "have fewer letters than five!"
  </code></pre>
  
  <p>I appreciate any help. Thanks for taking time to help me learn Python!</p>