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 user-entered 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 "password_checker.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 (+10): If the user enters the password incorrectly three times, output "Account locked." and exit.
Output
Example Runs:
Enter your password: wrong1 Incorrect password. Enter your password: correct Success!
Bonus only:
Enter your password: wrong1 Incorrect password. Enter your password: wrong2 Incorrect password. Enter your password: wrong3 Account locked.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!