title: How to find the middle of a line in a file
body: <p>I am writing a code for class and having some trouble finding the middle of a line. I have to prompt the user for a file, read it, split it into individual lines, and then add a specific word to the beginning, middle, and end of each line. I am not sure how to get the middle</p>
  
  <pre><code>file = str(input("Enter input file:" ""))
  my_file = open(file, "r")
  file_contents = my_file.read()
  #change all "e"s to "zw"s 
          for letter in file_contents:
              if letter == "e":
                  file_contents = file_contents.replace(letter, "zw")
  #add "hokie" to beginning, middle, and end of each line
          lines = file_contents.split('\n')
  #I know the following line is wrong, but I'm not sure how to fix it
          middle_message = lines[len(lines) /2:] + "hokie"
          message = "hokie" + middle_message + "hokie"
  </code></pre>