Question: For this challenge, you will be writing a program that stores 5 0 of the most common passwords ( contained at the end of this
For this challenge, you will be writing a program that stores of the most common passwords contained at the end of this instruction page in a List. You will then ask the user to create a username and password using a looping structure OR the in operator, check if the user's password is stored in the list, and IF it is print out: "Your password is too common. Please consider changing it In addition, you will need to print out the location in the List where the password is stored if one was already found, ie at index
If the password is not in the list, then ensure that the user enters at least one capital letter, one lowercase letter, a number, one special character from these # $ and is at least or more characters long. You will achieve this outcome by checking each character in the variable holding the user's password string. If the user does not have the aforementioned features, you will ask them to enter another password. Finally, you will append the user's password to the password database list and print out: "You have a strong password."
Program Instructions:
Create three functions:
def StoredPasswordscheckPass:
def getUserPass:
def main or if namemain:
Call getUserPass from main:
Create a List with of the most common passwords in StoredPasswordscheckPassTHE LIST IS CONTAINED BELOW
Ask the user to create a username and password you will need two different variable names here in the getUserPass function
Make sure to appropriately deal with integers and strings you can force everything to a string if needed
Call StoredPasswords from getUserPass and pass the user's password as an argument
ie result StoredPasswordsuserPass
Compare the user's password with the values in the List from inside the body of the StoredPasswordscheckPass function.
IF you get a match, stop comparing the values and store the string Your password is too common. Please consider changing it into a variable called found, which you can use to return back to the calling function.
IF no values match, then store the string: "You have a strong password." into a variable called notFound
Also ensure the user enters at least one capital letter, one lowercase letter, one number, and one special character from the list below.
# $
The password must be or more characters long.
If the user does not enter the correct values, then ask them to create a new password with the above restrictions
return the appropriate variable to getUserPass based on which IF statement is found to be true
Finally, print the location in the list where the password was found inside StoredPasswords
You will need to use the in operator OR a for loop to check the list. You will also need to use the index method.
In other words, you will be calling getUserPass fom Main Then you will be calling StoredPasswordscheckPass from getUserPass You will be passing an argument to getUserPasswordcheckPass from getUserPasswords StoredPasswordcheckPass stores the List, contains the for loop and If statements, and returns the appropriate print statement back to getUserPass GetUserPass asks the user to create a userName and password, calls StoredPasswords and passes the userPass argument to it GetUserPass then prints out the result variable.
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
