title: Converting a Text File to a String in Python
body: <p>I am new to python and am trying to find the largest word in the alice_in_worderland.txt. I think I have a good system set up ("See Below"), but my output is returning a "word" with dashes connecting multiple words. Is there someway to remove the dashes in the input of the file? For the text file visit <a href="http://openbookproject.net/thinkcs/python/english2e/resources/ch10/alice_in_wonderland.txt" rel="nofollow">here</a></p>
  
  <p>sample from text file:</p>
  
  <blockquote>
    <p>That's very important,' the King said, turning to the jury. They were
    just beginning to write this down on their slates, when the White
    Rabbit interrupted:  UNimportant, your Majesty means, of course,' he
    said in a very respectful tone, but frowning and making faces at him
    as he spoke. " UNimportant, of course, I meant,' the King hastily
    said, and went on to himself in an undertone, important--unimportant--
    unimportant--important--' as if he were trying which word sounded
    best."</p>
  </blockquote>
  
  <p>code:</p>
  
  <hr>
  
  <pre><code>    #String input
      with open("alice_in_wonderland.txt", "r") as myfile:
          string=myfile.read().replace('\n','')
      #initialize list
      my_list = []
      #Split words into list
      for word in string.split(' '):
          my_list.append(word)
      #initialize list
      uniqueWords = []
      #Fill in new list with unique words to shorten final printout
      for i in my_list:
          if not i in uniqueWords:
              uniqueWords.append(i)
      #Legnth of longest word
      count = 0
      #Longest word place holder
      longest = []
      for word in uniqueWords:
          if len(word)&gt;count:
              longest = word
              count = len(longest)
          print longest
  </code></pre>