There was an error while loading. Please reload this page.
1 parent 2d95659 commit c2a2e3cCopy full SHA for c2a2e3c
app.py
@@ -0,0 +1,14 @@
1
+def encrypt(text, key=0):
2
+ if not isinstance(text, str):
3
+ raise TypeError("{} should be a type string".format(text))
4
+ if not isinstance(key, int):
5
+ raise TypeError("{} should be of type int".format(key))
6
+ return "".join([chr(ord(something) + key) for something in text])
7
+
8
9
+def decrypt(text, key=0):
10
11
12
13
14
+ return "".join([chr(ord(something) - key) for something in text])
0 commit comments