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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 ''')
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply