- Python:
1.Minimum length of 12 characters.
2.At least one lowercase letter.
3.At least one uppercase letter.
4.At least one digit.
5.At least one special character.
- Import re. Line 2
Re: A regular expression (or RE) specifies a set of strings that matches it; the functions in this module let you check if a particular string matches a given regular expression (or if a given regular expression matches a particular string, which comes down to the same thing).
2.Input function: Ex: password = input (“Enter Your Password. “) Line 5
The input function is used to ask the user of the program (not the programmer) a question, and then wait for a typed response. The typed number is then returned as the result of the function, and should usually be stored in a variable.
3.Using “if”: Ex: if len(password) < 12: Llines 6, and 19.
An “if” statement is a condition statement used to check a condition, and execute it if the condition holds true. It is also a control flow statement, which utilizes decision-making to control the flow of execution.
- Print(): EX: print(“Password must be at least 12 characters long.”) Lines 7,10,13,16,and 20.
The print() function prints the specified message to the screen, or other standard output device. The message can be a string, or any other object, the object will be converted into a string before being written to the screen.
5.elif: Ex: elif not re.search(“[A-Z]”, password): Lines 9,12, and 15.
elif is short for “else if” and is used when the first if statement isn’t true, but you want to check for another condition.
- Else: Ex (“Strong: Password meets the criteria.”)
The else keyword is used in conditional statements (if statements), and decides what to do if the condition is False.
[In The Terminal] it Shows Password Input and Checks the password against Predefined Rules for strength.
The Results: Checks Out.


