From f83393b0a7c1f5f3c47d11f140306dd00ac4bda0 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Thu, 24 Aug 2023 00:06:05 +0200 Subject: [PATCH] solved challenge 144 --- 000-999/144/inputs/input | 1 + 000-999/144/main.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 000-999/144/inputs/input create mode 100644 000-999/144/main.py diff --git a/000-999/144/inputs/input b/000-999/144/inputs/input new file mode 100644 index 0000000..58451e7 --- /dev/null +++ b/000-999/144/inputs/input @@ -0,0 +1 @@ +cvpbPGS{arkg_gvzr_V'yy_gel_2_ebhaqf_bs_ebg13_uJdSftmh} \ No newline at end of file diff --git a/000-999/144/main.py b/000-999/144/main.py new file mode 100644 index 0000000..55189e2 --- /dev/null +++ b/000-999/144/main.py @@ -0,0 +1,15 @@ +def rot13(message): + subs = {'A': 'N', 'B': 'O', 'C': 'P', 'D': 'Q', 'E': 'R', 'F': 'S', 'G': 'T', 'H': 'U', 'I': 'V', 'J': 'W', 'K': 'X', 'L': 'Y', 'M': 'Z', 'N': 'A', 'O': 'B', 'P': 'C', 'Q': 'D', 'R': 'E', 'S': 'F', 'T': 'G', 'U': 'H', 'V': 'I', 'W': 'J', 'X': 'K', 'Y': 'L', 'Z': 'M', + 'a': 'N', 'b': 'O', 'c': 'P', 'd': 'Q', 'e': 'R', 'f': 'S', 'g': 'T', 'h': 'U', 'i': 'V', 'j': 'W', 'k': 'X', 'l': 'Y', 'm': 'Z', 'n': 'A', 'o': 'B', 'p': 'C', 'q': 'D', 'r': 'E', 's': 'F', 't': 'G', 'u': 'H', 'v': 'I', 'w': 'J', 'x': 'K', 'y': 'L', 'z': 'M'} + + return ''.join(list(map( + lambda x: subs[x] if x in subs else x, + message + ))) + + +if __name__ == '__main__': + with open('./000-999/144/inputs/input') as file: + input = file.read() + + print(rot13(input))