[Python] Python - Ord() [Python] Python - Ord()
🏚️
Halfway House
Week 26, 2026
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