Question: In this lab you must create a program that checks if user - entered password is valid. For this scenario we will check the password
In this lab you must create a program that checks if userentered password is valid. For this scenario we will check the password against a hardcoded value. The program must meet the following criteria:
Program is in a file named "passwordchecker.py
The correct password should be hardcoded to the string "correct".
If the password is correct, output "Success!" and exit.
If the password is incorrect, output "Incorrect password." and prompt the user again.
BONUS : If the user enters the password incorrectly three times, output "Account locked." and exit.
Output
Example Runs:
Enter your password: wrong Incorrect password. Enter your password: correct Success!
Bonus only:
Enter your password: wrong Incorrect password. Enter your password: wrong Incorrect password. Enter your password: wrong Account locked.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
