abc_plain = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
abc_cipher = "π‘ͺπ’π’Ίπ£π£π€π€§π₯
π€·π₯π₯π€π¦π¦π§·π £π °αΰΌ
βΏΚββΏα¦κ¨β‘"
def enc(text):
result = ""
for c in text:
i = abc_plain.find(c.upper())
if i >= 0 and i < len(abc_cipher):
result += abc_cipher[i]
return result
def dec(text):
result = ""
for c in text:
i = abc_cipher.find(c)
if i >= 0 and i < len(abc_plain):
result += abc_plain[i]
return result
input = "THIS IS A TEST ABC XYZ"
print(input)
print(enc(input))
print(dec(enc(input)))THIS IS A TEST ABC XYZ βΏπ₯ π€·ΰΌ π€·ΰΌ π‘ͺβΏπ£ΰΌ βΏπ‘ͺπ’π’Ία¦κ¨β‘ THISISATESTABCXYZ