|
|
|
users = {} |
|
|
|
|
|
def signup(): |
|
|
|
username = input("Enter a username: ") |
|
password = input("Enter a password: ") |
|
|
|
users[username] = password |
|
print("Signup successful!") |
|
|
|
|
|
def login(): |
|
|
|
username = input("Enter your username: ") |
|
password = input("Enter your password: ") |
|
|
|
if (username in users) and (users[username] == password): |
|
print("Login successful!") |
|
else: |
|
print("Invalid username or password. Please try again.") |
|
|
|
|
|
while True: |
|
choice = input("Would you like to signup or login? (s/l) ") |
|
if choice == 's': |
|
signup() |
|
elif choice == 'l': |
|
login() |
|
else: |
|
print("Invalid choice. Please try again.") |
|
|