title: Really weird issue with CodeHS
body: <p>I am doing some CodeHS for my computer science class at my school and for some reason my program doesnt meet the criteria of the grader, and maybe someone can assist me.</p>
  
  <p>The autograder is looking for this:</p>
  
  <p><a href="https://i.stack.imgur.com/FOaoP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FOaoP.png" alt="enter image description here"></a></p>
  
  <p>The things it tests with are here:</p>
  
  <p><a href="https://i.stack.imgur.com/AU64E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AU64E.png" alt="enter image description here"></a></p>
  
  <p>and every result returns a runtime error in the autograder but not in the console. </p>
  
  <p>Heres my code:</p>
  
  <pre><code>def get_letter():
      while True:
          letter = str(input("Enter a letter:\n&gt; "))
      if letter.isupper() == True:
          print("Character must be a lowercase letter!")
          continue
      if len(letter) &gt; 1 or len(letter) &lt; 1:
          print("Must be 1 character!")
      elif letter.islower() == True:
          return letter
          break
  
  def get_index():
      while True:
          try:
              index = int(input("Enter an index (-1 to quit):\n&gt; "))
              if index == -1:
                  break
              if index &gt; len(word) or index &lt; 0:
                  print "Invalid index"
                  continue
              if index &lt;= len(word):
                  global letter 
                  letter = get_letter()
                  return index
                  break
          except ValueError:
              print "Please enter a number"
              continue
  
  
  
  word = input("Enter a word\n&gt; ")
  words = list(word)
  
  while True:
      try:
          indexes = get_index()
          splitword = words[:indexes] + [letter] + words[indexes +1:]
          joinedword = ''.join(splitword)
          print joinedword
      except NameError:
          break
  </code></pre>
  
  <p>and here are the instructions:
  <a href="https://i.stack.imgur.com/7nIzI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7nIzI.png" alt="enter image description here"></a></p>
  
  <p>The CodeHS lesson is 8.3.8 Word Latter</p>