+ 3

Password Validation [ Solved ]😁

Need help, please. Failed in Test Case #5 only. Can anyone tell me about Case # 5

9th Nov 2021, 12:12 PM
🇲🇲☃️(0_0)☃️🇲🇲
🇲🇲☃️(0_0)☃️🇲🇲 - avatar
9 Answers
0
The description just says that the password should be at least 7 characters long. There's no limit of how long the password can be.
9th Nov 2021, 1:03 PM
你知道規則,我也是
你知道規則,我也是 - avatar
9th Nov 2021, 3:46 PM
SoloProg
SoloProg - avatar
+ 4
No, but can you show us your code
9th Nov 2021, 12:13 PM
°-°
°-° - avatar
+ 3
Remove 14 in the first bracket. "^(?=.{7,}$)(?=(?:.*?\w){0,})(?=(?:.*?\d){2})(?=(?:.*[!@#$%&*]){2}).*
quot;
9th Nov 2021, 12:33 PM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 2
Here is my code. import re password = input() reg = "^(?=.{7,14}$)(?=(?:.*?\w){0,})(?=(?:.*?\d){2})(?=(?:.*[!@#$%&*]){2}).*
quot; match = re.compile(reg) search = re.search(match, password) if search: print("Strong") else: print("Weak")
9th Nov 2021, 12:15 PM
🇲🇲☃️(0_0)☃️🇲🇲
🇲🇲☃️(0_0)☃️🇲🇲 - avatar
0
It's work. Thank you bro. But I don't clear on removing 14. For the password length, why don't need to set 14? Can you explain me please bro 🙂
9th Nov 2021, 12:41 PM
🇲🇲☃️(0_0)☃️🇲🇲
🇲🇲☃️(0_0)☃️🇲🇲 - avatar
0
Misunderstanding about question 😁
9th Nov 2021, 1:13 PM
🇲🇲☃️(0_0)☃️🇲🇲
🇲🇲☃️(0_0)☃️🇲🇲 - avatar
0
What is wrong with this code as a password validator password = input() char=["!","@","
quot;,"%","&","*"] numbers = [1,2,3,4,5,6,7,8,9,0] for i in password : if len(password) >= 7: if i in numbers : p += 2 if i in char : a += 2 print ("strong") else : print ("weak")
19th Sep 2022, 5:09 PM
David Adeyemo Adeoluwa
David Adeyemo Adeoluwa - avatar