def machine():
    # creating key strings
    keys = '<KEY>'
    # auto generating the vaules of strings
    # value will be generted by taking last to first
    # concatinated with the rest of the string
    values = keys[-1] + keys[0:-1]
    # print(keys)
    # print(values)

    # creating two dictionaries
    encrytDict = dict(zip(keys, values))
    decryptDict = dict(zip(values, keys))

    # user input
    message = input("Enter your secret message : ")
    mode = input("Crypto Mode : Encode(E) OR Decode(D) ----> ")

    #encode and decode
    if mode.upper() == 'E':
        newMessage = ''.join([encrytDict[letter]
                              for letter in message.lower()])
    elif mode.upper() == 'D':
        newMessage = ''.join([decryptDict[letter]
                              for letter in message.lower()])
    else:
        print("Please try again, wrong choice entered")

    return newMessage.capitalize()


print(machine())
def machine():
    # creating key strings
    keys = '<KEY>'
    # auto generating the vaules of strings
    # value will be generted by taking last to first
    # concatinated with the rest of the string
    values = keys[-1] + keys[0:-1]
    # print(keys)
    # print(values)

    # creating two dictionaries
    encrytDict = dict(zip(keys, values))
    decryptDict = dict(zip(values, keys))

    # user input
    message = input("Enter your secret message : ")
    mode = input("Crypto Mode : Encode(E) OR Decode(D) ----> ")

    #encode and decode
    if mode.upper() == 'E':
        newMessage = ''.join([encrytDict[letter]
                              for letter in message.lower()])
    elif mode.upper() == 'D':
        newMessage = ''.join([decryptDict[letter]
                              for letter in message.lower()])
    else:
        print("Please try again, wrong choice entered")

    return newMessage.capitalize()


print(machine())
# creating key strings # auto generating the vaules of strings # value will be generted by taking last to first # concatinated with the rest of the string # print(keys) # print(values) # creating two dictionaries # user input #encode and decode