I am attempting to create a loop for a login code and have been struggling to format this code to reach the "User Accepted" on line (16). How could I reformat this to allow this code to work correctly?
##### USER INFO #####
Users = {
'jc1':123
,'jc2':213
,'jc3':312
,'jc4':321
,'jc5':231}
ADPIN = '14726'
##### LOG-IN #####
while True: #Loop Creation
JK = input('Please enter your username: ') #Username Check
if JK in Users:
DK = input('Please enter your password: ') #Password Check
print('Bug Text Main')
if JK and DK in Users: #Problem Statement
print('User Accepted: Hello '+JK+'.') #Unreachable Code
print('Objective Text')
else:
ToC = input('It appears that the username entered does not exist: Would you like to try again(Press: 1) or create an account(Press: 2)') #Retry / Account Creation
if ToC == '2':
AD = input('Please enter an administrative pin: ')
if AD == ADPIN:
add = input('Please enter a username: ')
tht = input('Please enter a password: ')
Users.update( {add:tht})
print('Bug Test Users Append')
else: #Restart / Retry
print('Bug Test Restart')
Aucun commentaire:
Enregistrer un commentaire