Created
August 20, 2020 15:06
-
-
Save steverichey/315312586da09fda24405ef37f1888b3 to your computer and use it in GitHub Desktop.
This file contains 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 sys | |
simple_table = { | |
":encoded1:" : "a", | |
":encoded2:" : "b", | |
":encoded3:" : "c", | |
":encoded4:" : "d", | |
":encoded5:" : "e", | |
":encoded6:" : "f", | |
":encoded7:" : "g", | |
":encoded8:" : "h", | |
":encoded9:" : "i", | |
":encoded10:" : "j", | |
":encodedb1:" : "k", | |
":encodedb2:" : "l", | |
":encodedb3:" : "m", | |
":encodedb4:" : "n", | |
":encodedb5:" : "o", | |
":encodedb6:" : "p", | |
":encodedb7:" : "q", | |
":encodedb8:" : "r", | |
":encodedb9:" : "s", | |
":encodedb10:" : "t", | |
":encodedc1:" : "u", | |
":encodedc2:" : "v", | |
":encodedc3:" : "w", | |
":encodedc4:" : "x", | |
":encodedc5:" : "y", | |
":encodedc6:" : "z" | |
} | |
def decode_message(str): | |
decoded = "" | |
codes = str.split(" ") | |
for code in codes: | |
decoded += simple_table[code.strip()] | |
return decoded | |
message = sys.argv[1:][0].lower() | |
encoded = decode_message(message) | |
print(encoded) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment