title: Why is my "for" loop not iterating through completely?
body: <p>I'm very new to python and have been working on cryptography. I was working on a Caesar Cipher but towards the end of the code, it stops working and only encrypts 1 of the chars in the string.</p>
  
  <p>Why is this happening?
  How can I fix it?</p>
  
  <pre><code>during = []
  preBool = True
  while preBool == True :
      pre = str(input("Enter your message: "))
      if pre.isalpha() == False:
          print("\nSorry, your input was not recognized.")
          print("-------------------------------------------------------")
          continue
      else:
          preBool = False
  for char in pre:
      during.append(char)
  print(during)
  
  while True:
      try:
          rot = int(input("Enter the rotation value: "))
      except ValueError:
          print("Sorry, your input was not recognized.")
          continue
      else:
          break
  #Here is where I'm having issues. 'Cipher' only prints the first letter.
  def encrypt(pre,rot):
     result = ""
     # transverse the plain text
     for i in range(len(pre)):
        char = pre[i]
        # Encrypt uppercase characters in plain text
  
        if (char.isupper()):
           result += chr((ord(char) + rot-65) % 26 + 65)
        # Encrypt lowercase characters in plain text
        else:
           result += chr((ord(char) + rot - 97) % 26 + 97)
        return result
  
  print ("Cipher: " + encrypt(pre,rot))
  </code></pre>