Created
July 18, 2020 02:51
-
-
Save KatUser/c109dd7258c21c09a6952f1aa6822af8 to your computer and use it in GitHub Desktop.
Ceaser_2 in EN sdvig_vpravo na 17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en_alphabet = [x for x in range(ord('a'), ord('z') + 1)] | |
#97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
# a b c d e f g h i j k l m n o p q r s t u v w x y z | |
# a - 97 b - 98 c - 99 d - 100 e - 101 f - 102 g - 103 h - 104 | |
# i - 105 j - 106 k - 107 l - 108 m - 109 n - 110 o - 111 p - 112 | |
# q - 113 r - 114 s - 115 t - 116 u - 117 v - 118 w - 119 x - 120 | |
# y - 121 z - 122 | |
# l = 108 / t = 116 | |
s = 'To be, or not to be, that is the question!' | |
n = 17 | |
for i in s: | |
i = i.lower() | |
if ord(i ) in en_alphabet: | |
if ord(i) + n in range(97, 123): | |
print(chr(ord(i)+n ), end = '') | |
else: | |
print(chr((ord(i)+n)-26), end = '') | |
else: | |
print(i, end ='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment