title: Letter Altering Code
body: <p>This script takes a sentence and encodes it. The code takes each letter in a given word and bumps it up in the alphabet by the length of the word.  So "cat" becomes "fwd", "small" becomes "xrfqq", and "small cat" becomes "xrfgg fwd".</p>
  
  <p>I wanted to see if there was anything I should have done differently or if ya'll had some suggestions for improvements.</p>
  
  <pre><code>#Letter altering code
  
  alphabet = ["a","b","c","d","e","f","g","h","i","j",
          "k","l","m","n","o","p","q","r","s","t",
          "u","v","w","x","y","z"]
  
  textIn= ""
  
  while textIn.lower != 'q':
      textIn = input("Type a sentence to be translated ('q' to quit).\n"\
                 ).lower()
      textOut = ""
  
  if textIn == 'q':
      break
  else:
      for word in textIn.split():
          newWord = ""
          for char in word:
              if char in alphabet:
                  pos = alphabet.index(char)
                  newPos = (pos + len(word))%26 
                  newChar = alphabet[newPos]
                  newWord += newChar
  
              else:
                  newWord += char
  
          textOut += newWord + " " 
  
  print(textOut)
  </code></pre>