This repository has been archived by the owner on Nov 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kodebyter.py
84 lines (52 loc) · 1.48 KB
/
kodebyter.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import string
import collections
def caesar(rotate_string, number_to_rotate_by):
upper = collections.deque(string.ascii_uppercase)
lower = collections.deque(string.ascii_lowercase)
upper.rotate(number_to_rotate_by)
lower.rotate(number_to_rotate_by)
upper = ''.join(list(upper))
lower = ''.join(list(lower))
return rotate_string.translate(str.maketrans(string.ascii_uppercase, upper)).translate(str.maketrans(string.ascii_lowercase, lower))
print("Welcome to Kode Byter!")
print("Press Ctrl+C at any time to exit")
print("Press Ctrl+Shift+C to copy")
print("Press Ctrl+Shift+V to paste")
print("Will exit in 5")
print("Enter message:")
message = input()
print("Enter rotation:")
rotation = input()
print(rotation)
print(caesar(message, int(rotation)))
print("Will exit in 4")
print("Enter message:")
message = input()
print("Enter rotation:")
rotation = input()
print(rotation)
print(caesar(message, int(rotation)))
print("Will exit in 3")
print("Enter message:")
message = input()
print("Enter rotation:")
rotation = input()
print(rotation)
print(caesar(message, int(rotation)))
print("Will exit in 2")
print("Enter message:")
message = input()
print("Enter rotation:")
rotation = input()
print(rotation)
print(caesar(message, int(rotation)))
print("Will exit in 1")
print("Enter message:")
message = input()
print("Enter rotation:")
rotation = input()
print(rotation)
print(caesar(message, int(rotation)))
print("Will exit in 0")
print("Press enter to exit...")
exit = input()