title: Why doesn't this work for the last 4 or 5 indexes of the string?
body: <p>The purpose of this code is to make the odd placed letters uppercase and the odd ones lowercase.</p>
  <pre><code>def myfunc(word):
      new_word = ''
      for let in word:
          if (word.index(let) + 1) % 2 == 0:
              new_word += let.upper()
          elif (word.index(let) + 1) % 2 == 1:
              new_word += let.lower()
              
      return new_word
  </code></pre>
  <p>It works fine for the first few but when it gets towards the end it loses its brain cells.</p>
  <p>Input:
  <code>myfunc('Anthropomorphism')</code></p>
  <p>Output:
  <code>'aNtHrOpOmOrpHIsm'</code></p>
  <p>Expected Output:
  <code>'aNtHrOpOmOrPhIsM'</code></p>
  <p>Any ideas why it doesn't work?</p>