aboutsummaryrefslogtreecommitdiff
path: root/Python/Beginner training/Tasks.py
diff options
context:
space:
mode:
authorSyndamia <kami02882@gmail.com>2019-07-31 15:46:56 +0300
committerSyndamia <kami02882@gmail.com>2019-07-31 15:46:56 +0300
commite173839c44257d0187bb2ec087124db6e2ecde99 (patch)
tree52eb84ab8f858f1fe437e24d6104a0bdd50d17e2 /Python/Beginner training/Tasks.py
parenta48a6e1c302a5e90235a82e73517cd43f9c1432e (diff)
downloadSelf-learning-e173839c44257d0187bb2ec087124db6e2ecde99.tar
Self-learning-e173839c44257d0187bb2ec087124db6e2ecde99.tar.gz
Self-learning-e173839c44257d0187bb2ec087124db6e2ecde99.zip
Optimised Number names code
Diffstat (limited to 'Python/Beginner training/Tasks.py')
-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