21 lines
454 B
Python
21 lines
454 B
Python
def my_encode(message):
|
|
encoded_message = ''
|
|
for char in message:
|
|
encoded_message += chr(ord(char) + 7)
|
|
return encoded_message
|
|
|
|
|
|
def my_decode(message):
|
|
decoded_message = ''
|
|
for char in message:
|
|
decoded_message += chr(ord(char) - 7)
|
|
return decoded_message
|
|
|
|
|
|
message = "Witam"
|
|
encoded = my_encode(message)
|
|
decoded = my_decode(encoded)
|
|
|
|
print(f" Encoded: {encoded}")
|
|
print(f"Decoded: {decoded}")
|