-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab6.py
More file actions
27 lines (22 loc) · 723 Bytes
/
lab6.py
File metadata and controls
27 lines (22 loc) · 723 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
# username = user
# password = password
# loop menu
def menu():
print("Menu\n-------------")
print("1. Encode\n2. Decode\n3. Quit")
print()
print("Heyo")
def password_encode(password):
encoded = password
for digit in password:
encoded = int(password(digit)) + 3 % 10
return encoded
while True:
menu()
yolo = int(input("Please enter an option: "))
if yolo == 1:
password = int(input("Please enter your password to encode: "))
print("Your password has been encoded and stored!\n")
if yolo == 2:
password = password_encode(password)
print(f'The encoded password is {password_encode(encoded)}, and the original password is {password}\n')