Apr-25-2019, 12:47 PM
(This post was last modified: Apr-25-2019, 12:47 PM by SteampunkMaverick12.)
When I create a new account or retry login, It doesn't recognize and im unsure why
logged_in=False attempts=0 enter_name=input('ENTER NAME: ') enter_password=input('ENTER PASSWORD: ') with open('Data.txt', 'r') as file: for line in file: name, password = line.split(',') if name == enter_name: logged_in = password == enter_password break else: attempts+=1 print('WRONG USERNAME OR PASSWORD') enter_option=input('ENTER OPTIONS:\n A-RETRY\n B-NEW ACCOUNT\n') while enter_option=='A': enter_name=input('ENTER NAME: ') enter_password=input('ENTER PASSWORD: ') if name == enter_name: logged_in = password == enter_password break else: attempts+=1 print('WRONG USERNAME OR PASSWORD') enter_option=input('ENTER OPTIONS:\n A-RETRY\n B-NEW ACCOUNT\n') while enter_option=='B': with open('Data.txt', 'a') as file: enter_new_name=input('ENTER NEW NAME: ') enter_new_password=input('ENTER NEW PASSWORD: ') file.write(enter_new_name+','+enter_new_password+"\n") enter_name=input('ENTER NAME: ') enter_password=input('ENTER PASSWORD: ') if name == enter_name: logged_in = password == enter_password break else: attempts+=1 print('WRONG USERNAME OR PASSWORD') enter_option=input('ENTER OPTIONS:\n A-RETRY\n B-NEW ACCOUNT\n') if logged_in==True: print('Hello',name)