Python SolutionsPython Solutions
🏚️
Halfway House
Week 26, 2026
All SolutionsPython - Ord() | BMC | Python Solutions
def split_msg_in_twos(msg: str) -> list[str]:
ans: list[str]
ans = []
for i in range(0, len(msg), 2):
ans.append(msg[i:i+2])
return ans
def decode(msg: list[str]) -> str:
ans: str
ans = ""
for chars in msg:
ans += chr(ord(chars[0]) + ord(chars[1]))
return ans
# main
msg = "'91#08A$ B*$E>/45<8,G $K$B 1</J &F!@=1-:P%?\"(?@% #J05*7)E,G B2!G8- 3918C*63\"R6= %J/7 -@8A #TN!D.K!*:2. <B *\"%P!C3DD%C$ 2%81A33A52-8H&!RK)C\"/:3;"
msg = msg.split()
for m in msg:
print(decode(split_msg_in_twos(m)), end=" ")