title: String index out of range at line 27
body: <p>I'm trying to do a basic Ceaser cipher with non-complicated code and when I type something like Go Buy Bread and set the shift to 8 or higher I get an error called string index out of range and I don't want to use mod (%) can anyone give me a solution?</p>
  <pre><code>Alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 -!?.'
  
  
  FinalMessage = ''
  
  
  print(&quot;Cipher/Decipher Code&quot;)
  print(&quot;-&quot;)
  print(&quot;This code can encode messages and decode messages.&quot;)
  
  
  while True:
      print()
      Option = int(input('Type the number 1 to encode your message, number 2 to decode, number 3 to exit: '))  
      print()                                                                                                  
      if Option == 1:  
          Message = list(input(&quot;Type the message you want to encode: &quot;))  
          print()                                                         
          print(&quot;To encode the message type a number between 1 and 26.&quot;)  
          print(&quot;The number means how many letters the message will shift.&quot;)
          Key = int(input(&quot;Number: &quot;))  
          for Cipher in Message:  
              if Cipher in Alphabet:  
                  Position = Alphabet.find(Cipher) 
                  NewPosition = (Position + Key)
                  NewCipher = Alphabet[NewPosition]
                  FinalMessage += NewCipher  
              else:  
                  FinalMessage += Cipher 
          print()
          print(&quot;Encrypted Message: &quot; + FinalMessage) 
          print()
          print(&quot;------&quot;)
          print()
      elif Option == 2:
          print()
          Message = list(input(&quot;Type the message you want to decode: &quot;))
          print()
          print(&quot;To decode a message type a number between 1 and 26.&quot;) 
          print(&quot;The number means how many letters the message will shift&quot;)  
          Key = int(input(&quot;Number: &quot;))  
          Key = (Key * -1) 
          for Cipher in Message:  
              if Cipher in Alphabet: 
                  Position = Alphabet.find(Cipher) 
                  NewPosition = (Position + Key)
                  NewCipher = Alphabet[NewPosition]
                  FinalMessage += NewCipher
              else:  
                  FinalMessage += Cipher 
          print()
          print(&quot;Decrypted Message: &quot; + FinalMessage) 
          print()
          print(&quot;------&quot;)
          print()
      FinalMessage = &quot;&quot; 
  </code></pre>