-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (32 loc) · 1.1 KB
/
main.py
File metadata and controls
39 lines (32 loc) · 1.1 KB
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
# Dylon Wetzel
def encode(password):
encoded_password = ""
for digit in password:
new_digit = str(int(digit) + 3)
encoded_password += new_digit
return encoded_password
def decode(encoded_password):
password = ""
for digit in encoded_password:
original_digit = str(int(digit) - 3)
password += original_digit
return password
def main():
while True:
print("Menu")
print("-------------")
print("1. Encode")
print("2. Decode")
print("3. Quit")
choice = input("\nPlease enter an option: ")
if choice == "1":
password = input("\nPlease enter your password to encode: ")
encoded_password = encode(password)
print("\nYour password has been encoded and stored!\n")
elif choice == "2":
# password = decode(encoded_password)
print(f"\nThe encoded password is {encoded_password}, and the original password is {password}.\n".format(encoded_password, password))
elif choice == "3":
break
if __name__ == '__main__':
main()