title: Python Text Files, print list with all words that begin with 'the'
body: <p>I have to write code that makes a list of all the words that start with 'the' (such as there, therefore, then, the). But not have any duplicates in the list. Can anyone help? This is what I have so far.</p>
  
  <pre><code>def getbook():
      bookname = input("What is the name of the text file?")
      bookFile = open(bookname, 'r')
      bookString = bookFile.read()
      lowerBook = bookString.lower()
      wordList = lowerBook.split()
      return wordList
  
  import string
  
  def listAllThe(longString):
      theList = []
      for i in longString:
          if i == 'the':
              theList.append( i)
      return theList
  
  def final():
      book = getbook()
      getList = listAllThe(book)
      print (getList)
  
  final()
  </code></pre>