-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWhileLoops.py
More file actions
30 lines (30 loc) · 1 KB
/
Copy pathWhileLoops.py
File metadata and controls
30 lines (30 loc) · 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
stillGoing = True
BankAccounts = {}
while stillGoing:
print("What would you like to do today?")
print("1. Sign up for an account")
print("2. Log into an account")
print("3. Quit")
try:
choice = int(input("Choice: "))
except ValueError:
print("Choice isn't an integer, try again")
if choice == 1:
newUsername = input("Enter a username: ")
newPassword = input("Enter a password: ")
BankAccounts[newUsername] = newPassword
elif choice == 2:
Username = input("Enter a username: ")
try:
Password = BankAccounts.get(Username)
if input("Enter a password: ") == Password:
print("Authorized")
else:
print("Denied Access, please try again")
except:
print("Username isn't recognized, please try again")
elif choice == 3:
stillGoing = False
else:
print("Choice isn't recognized, please try again")
print()