import random
import string

def encode(secret, step): output = "" for i in secret: output = output + i for j in step: output = output + random.choice(string.ascii_lowercase) return output
def decode(code, step): return code[::step]
def main(): secret = input("Enter a secret word") step = int(input("Enter a positive integer")) code = encode(secret, step) print("Your code is:") print(code) print() decoded = decode(code, step) print("I can decode it back to:") print(decoded)
main()