basic-mod1

This commit is contained in:
Maxime Vorwerk
2024-07-08 14:00:31 +02:00
parent fe0e1b2411
commit 7cd45f9bbe
2 changed files with 20 additions and 0 deletions

19
basic_mod1/sol.py Executable file
View File

@@ -0,0 +1,19 @@
#!/home/maxime/.pyvenv/bin/python3
with open("message.txt", 'r') as f:
text = f.read().strip()
cipher = text.split(' ')
dec = ""
for i in cipher:
i = int(i)
i %= 37
if i <= 25:
dec += chr(ord('a') + i)
elif i <= 35:
dec += chr(ord('0') + i - 26)
elif i == 36:
dec += '_'
print(dec)