+ 3
Password Validation [ Solved ]😁
Need help, please. Failed in Test Case #5 only. Can anyone tell me about Case # 5
8 ответов
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.
+ 5
https://www.sololearn.com/Codes?ordering=MostRecent&query=Password%20Validation
Keep learning & happy coding :D
+ 4
No, but can you show us your code
+ 3
Remove 14 in the first bracket.
"^(?=.{7,}$)(?=(?:.*?\w){0,})(?=(?:.*?\d){2})(?=(?:.*[!@#$%&*]){2}).*quot;
+ 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")
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 🙂
0
Misunderstanding about question 😁
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")