#Activity 12.2.1 - caesar cipher encoder

def caesar_cipher_encrypt(message, key):
    # ...
    # ...
    characters = ['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',
                 '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']
    
    # ...
    numberInList = len(characters)

    # ...
    encryptedMessage = ""

    # ...
    for nextCharacter in message:

        # ...
        inList = False
        
        # ...
        index = 0
        
        # ...
        while index < numberInList:
            newPosition = 0

            # ...
            if nextCharacter == characters[index]:  
               
                # ...
                inList = True
                
                # ...
                newPosition = index + key

                # ...
                if newPosition >= numberInList:
                    newPosition -= numberInList
                encryptedChar = characters[newPosition]
                 
           # ...
            index += 1

       # ...
        if inList:
             encryptedMessage += encryptedChar

        # ...
        else:
            encryptedMessage += nextCharacter
    return encryptedMessage

#  Main program
message = input('Enter the message to encrypt: ')
key = int(input('Enter the key: '))
encrypted = caesar_cipher_encrypt(message, key)
print (encrypted)
