Created
March 5, 2017 02:24
-
-
Save arthuralvim/4d50159e58ff50b689b3f35a23515f8c to your computer and use it in GitHub Desktop.
Decifrando em Python.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
alfabeto = string.ascii_uppercase | |
matriz_alfabeto = [alfabeto[x * 5:(x * 5) + 5] for x in range(0, 6)] | |
mensagem = ['14', '34', '42', '25', '11', '31', '42', '41', '11', '41', '51', '', '14', '11', '34', '11', '', '53', '44','', '12', '34', '11', '31', '53', '44', '', '54', '34', '11', '43', '44', '14', '11', '34', '51', '43', '31', '42', '11', '', '14', '11', '34', '11', '', '53', '44', '', '14', '53', '41', '51', '34', '53', '44', '53', '44'] | |
for msg in mensagem: | |
if not msg: | |
print ' ', | |
continue | |
x, y = list(msg) | |
print matriz_alfabeto[int(y) - 1][int(x) - 1], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment