0
Program to check password (strong or weak)
This program takes an input as password from the user and the program check that the password is strong or weak. The password is valid if it has at a minimum 2 numbers, 2 of the following special characters ('!', '@', '#', '
#x27;, '%', '&', '*'), and a length of at least 7 characters. If the password passes the check, output 'Strong', else output 'Weak'. Input Format: A string representing the password to evaluate. Output Format: A string that says 'Strong' if the input meets the requirements, or 'Weak', if not. Sample Input: Hello@$World19 Sample Output: Strong import re pswd = input() special = re.sub ("[!@#$%&*]", "", pswd) nums = re.sub ("[\d]", "", pswd) if len(pswd) < 7 or len(special) == len(pswd) or len(nums) == len(pswd): print ("Weak") else : print ("Strong")2 odpowiedzi
0
Hello Parthasarathi Panda, what exactly is your question? Do you want someone to write the code for you or explain how to do it?
0
Ans is also there. Could you please explain the code