8.SecretEncodingandDecoding.py
# Write a program to translate a message into secret code language. # Use the rules below to translate normal English into secret code language. # Coding: # if the word contains atleast 3 characters: # remove the first letter and append it at the end now append three random characters at the starting and the end # now append three random characters at the starting and the end # else: # simply reverse the string # Decoding: #if the word contains less than 3 characters: # reserve it #else: # remove 3 random characters from start and end. Now remove the last letter append it to the beginning import random # Function to generate a random prefix def generate_prefix (): prefixes = [ 'asd' , 'jhg' , 'iuy' , 'ert' , 'bnm' ] return random.choice(prefixes) def generate_postfix (): postfixes = [ 'asd' , 'jhg' , 'iuy' , 'ert' , 'bnm' ] return random.choice(postfixes) choice...