aboutsummaryrefslogtreecommitdiff
path: root/Python/Beginner training
diff options
context:
space:
mode:
Diffstat (limited to 'Python/Beginner training')
-rw-r--r--Python/Beginner training/Tasks.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/Python/Beginner training/Tasks.py b/Python/Beginner training/Tasks.py
index 873bde6..d60a8bf 100644
--- a/Python/Beginner training/Tasks.py
+++ b/Python/Beginner training/Tasks.py
@@ -65,7 +65,28 @@ def Factoriel():
print(final_int)
-Divide()
-Histogram()
-NumberMatrix()
-Factoriel() \ No newline at end of file
+def CaesarCypher():
+ while True:
+ key = input("Type a key: ")
+ msg = input("Type a message: ")
+
+ decoded = [] ; encoded = []
+ for c in msg:
+ decoded.append(c - key)
+ encoded.append(c + key)
+
+ print(end="Decoded message: ")
+ for c in decoded:
+ print(end=c)
+ print()
+
+ print(end="Encoded message")
+ for c in encoded:
+ print(end=c)
+
+
+#Divide()
+#Histogram()
+#NumberMatrix()
+#Factoriel()
+CaesarCypher() \ No newline at end of file