title: Decrypting Input?
body: <p>This is my assignment:</p>
  
  <p>Write a program which DECRYPTS secret messages.</p>
  
  <p>It should first prompt the user for the scrambled alphabet. It then should ask for the secret message. Finally, it outputs the unscrambled version.</p>
  
  <p>Note that there are exactly 26 characters input for the scrambled alphabet. All alphabetic characters are translated into their decoded equivalents (which will take a WHILE loop), and all other, non-alphabetic characters should be output exactly as they were without translation.</p>
  
  <p>This is my code so far:</p>
  
  <pre><code>decrypt = ["*"] * 26
  
  scram_alphabet = input("Please input the scrambled alphabet in order: ")
  
  while len(scram_alphabet) != 26:
      scram_alphabet = input("Please input the scrambled alphabet in order. The alphabet must have 26 characters: ")
  
  num = 0
  
  for each_letter in scram_alphabet:
      decrypt[num] = ord(each_letter)
      num = num + 1
  
  print()
  
  print("Your scrambled alphabet is: ", end = "")
  
  for num in range (26):
      print(chr(decrypt[num]), end = "")
  
  print()
  print()
  
  msg = input("Now input your scrambled message: ")
  
  print()
  print()
  
  alphabet = 65
  
  for s in range (26):
      decrypt[s] = (alphabet)
      alphabet = alphabet + 1
  
  print("The unscrambled alphabet is: ", end = "")
  
  
  for num in range (26):
      print(chr(decrypt[num]), end = "")
  
  print()
  print()
  
  print("Your unscrambled message reads: ")
  
  for alpha in msg.upper():
      if alpha &lt; "A" or alpha &gt; "Z":
          print(alpha, end="")
      else:
          ord_alpha = ord(alpha)
          print (chr(decrypt[ord_alpha - 65]), end = "")
  </code></pre>
  
  <p>Ex: Scrambled Alphabet = XQHAJDENKLTCBZGUYFWVMIPSOR , Scrambled Message = VNKW KW BO 1WV WJHFJV BJWWXEJ!          </p>
  
  <p>Everything works fine until I get to the last print statement, where it says that the unscrambled message is the same as the scrambled message. I know that the instructions call for a while loop but I couldn't figure out how to use one to decode the alphabet. </p>
  
  <p>Any helpers? </p>