-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaiwo.py
More file actions
28 lines (27 loc) · 698 Bytes
/
taiwo.py
File metadata and controls
28 lines (27 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys
def CeaserEncoder(shift):
message = input()
new_str = ""
new_new = ""
another_str = ""
for i in message:
if i.isalpha():
new_str += i
new_str = new_str.upper()
for j in new_str:
if ord(j) + shift > 90:
another_str += chr(ord(j) - (26 - shift))
else:
another_str += chr(ord(j)+shift)
counter = 5
new_line_counter = 0
for q in range(0,len(another_str),5):
new_new += another_str[q:counter]
new_new += " "
counter += 5
new_line_counter += 1
if not new_line_counter % 10:
new_new += "/n"
return new_new
q = int(sys.argv[1])
print(CeaserEncoder(q))