+ 1
How to solve it?
You're interviewing to join a security team. They want to see you build a password evaluator for your technical interview to validate the input. Task: Write a program that takes in a string as input and evaluates it as a valid password. 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: Strong6 ответов
+ 2
Please always post your attempt so we can help you improve.
🌟ᴀɴᴜʀᴀɢ[STUDY 📚]🌟 method of solving it is correct and I have attached how I solved it in a similar method.
Here is how I solved the problem:
https://code.sololearn.com/cyFFgWA0f5bu/?ref=app
+ 2
Rostislav Khalilov
Steps:
1.=>Make array of special characters
2.=>Take Password from the input and story in it any variable name as per your choice
3.=>Make 3 Variables like:
numbChar,numLette,numInt
And store 0 in it
4.Use for loop to transverse the user input password
5.Use condition
( i )=>if char in chars:
add one to numbChar
and like this use isDigit()
and isAlpha()
6.=>and in last add one condition
if (numbChar>=2 && numbint>=2 && len(password)>=7{
Console.write("Strong ");
else{
Console.write(" Weak");
}
If I have done any mistake in above programming then sorry for that because all function which is used are python because I have learn python.so thanks for giving me chance to help you😃😃
+ 1
Rostislav Khalilov
I think this is your code coach 1st show your attempt than we can tell what is wrong with your code.Then we can help if you have not attempt than go and take paper ,pencil and eraser write what the code coach is.saying and after that write on your paper and try again if again there is any problem then tell us
+ 1
the problem is that I don't know how to solve it
+ 1
Ok
0
Wait....I am telling