Page 1 of 1

Using python create a program that will: Login. The user should be prompted to enter a username and password. A list of

Posted: Mon Jul 11, 2022 9:55 am
by answerhappygod
Using python create a program that will:
Login. The user should be prompted to enter a username andpassword. A list of valid usernames and passwords are stored in atext file called logUser.txt. Display an appropriate error messageif the user enters a username that is not listed in logUser.txt orenters a valid username but not a valid password. The user shouldrepeatedly be asked to enter a valid username and password untilthey provide appropriate credentials.
If the user has successfully login the following list shoulddisplay:
- Register user: the user should be able to register when theyselect register
- Add tasks: a message should display "Coming Soon" when addtasks is selected
- View tasks: a message should display "No tasks avaliable" whenview tasks is selected
- Exit
logUser.txt
jerry, admin@
hell@, log1n
Here is my code
user_file = open('logUser.txt',' r+'):
print("---Login--")username= input("Enter username:")password= input("Enter password:")if username == "admin,": new_userLogin = Trueif password == "adm1n": new_userPass= Truevalid_userName= input("Enter username and password:")if valid_userName == open('logUser.txt', 'r+'): print("Valid user") choices = input('''Select option one below: r - register a - add task va - view all tasks e - exit ''')