title: Python 3.3: How to grab every 5th word in a text file?
body: <p>I'm trying to have my program grab every fifth word from a text file and place it in a single string. For instance, if I typed "Everyone likes to eat pie because it tastes so good plus it comes in many varieties such as blueberry strawberry and lime" then the program should print out "Everyone because plus varieties and." I must start with the very first word and grab every fifth word after. I'm confused on how to do this. Below is my code, everything runs fine except the last 5 lines.</p>
  
  <pre><code>#Prompt the user to enter a block of text.
  done = False
  textInput = ""
  while(done == False):
      nextInput= input()
      if nextInput== "EOF":
          break
      else:
          textInput += nextInput
  
  #Prompt the user to select an option from the Text Analyzer Menu.
  print("Welcome to the Text Analyzer Menu! Select an option by typing a number"
      "\n1. shortest word"
      "\n2. longest word"
      "\n3. most common word"
      "\n4. left-column secret message!"
      "\n5. fifth-words secret message!"
      "\n6. word count"
      "\n7. quit")
  
  #Set option to 0.
  option = 0
  
  #Use the 'while' to keep looping until the user types in Option 7.
  while option !=7:
      option = int(input())
  
  #I'm confused here. This is where I'm stuck. Is the 'for' loop correct for this `#situation?`
  #If the user selects Option 5,
      elif option == 5:
          for i in textInput.split():
              if i &lt;= 4 and i &gt;= 6:
                  print(textInput)
  </code></pre>