-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
42 lines (32 loc) · 961 Bytes
/
main.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
# Ethan Cleary
def encode(password):
global enc_password
enc_password = ''
for num in password:
new_num = str(int(num) + 3)
enc_password = enc_password + new_num
return enc_password
# Alisia Nguyen
def decode(password):
dec_password = ''
for num in enc_password:
new_num = str(int(num) - 3)
dec_password = dec_password + new_num
return dec_password
while True:
print("Menu")
print("-------------")
print("1. Encode")
print("2. Decode")
print("3. Quit")
print("")
option = int(input("Please enter an option: "))
if option == 1:
password = input("Please enter your password to encode: ")
print("Your password has been encoded and stored!")
print("")
elif option == 2:
print(f"The encoded password is {encode(password)}, and the original password is {decode(password)}.")
print("")
elif option == 3:
break