From 21cef5411eab8e8c32047856f52a87d3638794de Mon Sep 17 00:00:00 2001 From: Neeraj Date: Sat, 3 Oct 2020 22:44:16 +0530 Subject: [PATCH 1/2] feat: added basic caesar encoder decoder in python --- CONTRIBUTORS.md | 6 ++++++ python/code0987_caesar_encode_decode.py | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 python/code0987_caesar_encode_decode.py diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 61520605..77dd65d4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -460,3 +460,9 @@ Place: Bali, Indonesia
Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
Email: chibisd10@gmail.com
+ +Name: [Neeraj](https://github.com/Code0987)
+Place: World
+Field Experience: Software Engineer
+Coding Experience: TS/JS, Python, NodeJS, Java.
+Email: neeraj@ilusons.com
diff --git a/python/code0987_caesar_encode_decode.py b/python/code0987_caesar_encode_decode.py new file mode 100644 index 00000000..009ad81b --- /dev/null +++ b/python/code0987_caesar_encode_decode.py @@ -0,0 +1,5 @@ +def caesar_encode(s, k, pool='ABCDEFGHIJKLMNOPQRSTUVWXYZ'): return s.translate(str.maketrans(pool, pool[k:]+pool[:k])) +def caesar_decode(s, k, pool='ABCDEFGHIJKLMNOPQRSTUVWXYZ'): return s.translate(str.maketrans(pool, pool[-k:]+pool[:-k])) + +print(caesar_encode('HELLO', 3)) +print(caesar_decode('KHOOR', 3)) \ No newline at end of file From 2b0c11ee519f986f297599524a23bac9e809aa4c Mon Sep 17 00:00:00 2001 From: Neeraj Date: Sat, 3 Oct 2020 22:55:16 +0530 Subject: [PATCH 2/2] fix: updated path --- python/{ => caesar}/code0987_caesar_encode_decode.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename python/{ => caesar}/code0987_caesar_encode_decode.py (100%) diff --git a/python/code0987_caesar_encode_decode.py b/python/caesar/code0987_caesar_encode_decode.py similarity index 100% rename from python/code0987_caesar_encode_decode.py rename to python/caesar/code0987_caesar_encode_decode.py