title: How do I make a single letter in a string uppercase
body: <p>I am trying to take an input text file and make every "i" that is by itself uppercase. This is my code so far, but it creates one long line of code instead of keeping the line breaks and paragraphs. </p>
  
  <pre><code>with open("greenEggsAndHam.txt", "r") as myfile:
      iText = myfile.read().split()
  
  oText = ''
  
  for word in iText:
      if(word == "i"):
          word = word.upper()
      oText = oText + word + " "
  print oText
  </code></pre>
  
  <p>the output is now like this:</p>
  
  <pre><code>I am Sam Sam I am That Sam-i-am!That Sam-i-am! I do not like that Sam-i-am!
  </code></pre>
  
  <p>instead of this:</p>
  
  <pre><code>I am Sam
  Sam I am
  
  That Sam-i-am!
  That Sam-i-am!
  I do not like that Sam-i-am!
  </code></pre>
  
  <p>is there a way to do this while keeping paragraphs and line breaks?</p>