@@ -0,0 +1,1318 @@
+def main():%0A    message = input(%22Enter an encrypted msg: %22)%0A%0A    length = len(message)%0A%0A    if length %25 2 != 0:%0A        bam = int(length / 2)%0A        first_part = message%5B:bam%5D%0A        second_part = message%5Bbam + 1:%5D%0A    else:%0A        bam = int(length / 2)%0A        first_part = message%5B:bam%5D%0A        second_part = message%5Bbam:%5D%0A%0A    msg = second_part + first_part%0A%0A    length_alphabet = int(msg.split('~')%5B0%5D)%0A%0A    length_key = int(msg.split('~')%5B2%5D)%0A%0A    alphabet = msg.split('~')%5B1%5D%5B:length_alphabet%5D%0A    key = msg.split('~')%5B1%5D%5B::-1%5D%5B:length_key%5D%5B::-1%5D%0A    encrypted_message = msg.split('~')%5B1%5D%5Blength_alphabet:len(msg.split('~')%5B1%5D) - length_key%5D%0A%0A    resized_key = %5B%5D%0A    j = 0%0A%0A    for i in range(0, len(encrypted_message)):%0A        resized_key.append(key%5Bj%5D)%0A%0A        if j + 1 == length_key:%0A            j = 0%0A        else:%0A            j += 1%0A%0A    result = %5B%5D%0A%0A    for i in range(0, len(encrypted_message)):%0A        pos_encryp_msg = alphabet.index(encrypted_message%5Bi%5D)%0A        pos_key = alphabet.index(resized_key%5Bi%5D)%0A%0A        current_pos = pos_encryp_msg - pos_key%0A%0A        if current_pos %3C 0:%0A            current_pos += length_alphabet%0A%0A        result.append(alphabet%5Bcurrent_pos%5D)%0A%0A    print(40 * '-')%0A    print(%22The original message is: %7B%7D%22.format(''.join(result)))%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

add encrypted message task