Question
At a certain university, passwords for the universitys network must be at least 7 characters long. Write a program ( main() ) to display the
At a certain university, passwords for the universitys network must be at least 7 characters long.
Write a program ( main() ) to display the criteria for the password, and ask the user for their password.
Pass the password to a function ( validate_password ) that will evaluate whether the password is valid or not and return True or False. Then main() will output a message to the user telling them whether their password has been accepted, or if they must try again.
Remember the len() function!
Once you have this working add more tests to the validation function to ensure that the password also has:
- At least one lower-case character
- At least one upper-case character
- At least one numerical character
Finally, create a list of special characters (like @, !, # etc) and require at least one of those as well J
Python has functions like .isupper(), .islower(), .isdigit() which will be useful. Dont forget the in keyword either J
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started