- 4
Some one send me test case 8 for the password validator please
Password validator
14 Respostas
+ 4
Kith Stack
Some Test cases are hidden so you need to write generic logic to pass all test cases.
+ 4
@Kth Stack , Show your attempt please
+ 4
Rellot's screwdriver
No maximum is not 5. In this practice we have more than 5.
+ 3
Kith Stack
Pro and Non-Pro doens't matter for the test cases. Everyone should learn so some test cases should be hidden.
+ 3
I think your code is not passing because you are using multiple '#x27; sign in the list and not using '&'.
specials = ['!','@','#','#x27;,'%','#x27;,'*']
Your list should be like this:
specials = ['!','@','#','#x27;,'%','&','*']
+ 2
The future is now thanks to science[In a break]
Yes you are right.
Kith Stack
Don't complicate your logic. Here is simple one
def validator(password):
integers = '0123456789'
specials = '!@#$%&*'
d, s = 0, 0
for c in password:
if c in specials:
s += 1
if c in integers:
d += 1
if s >= 2 and d >= 2 and len(password) >= 7:
print('Strong')
else:
print('Weak')
passwd = input()
validator(passwd)
+ 1
hmm, when did sololearn have 8 test cases, the maximum is 5
+ 1
Kith Stack
Not 10 there is 13 test cases.
0
Rellot's screwdriver , the password validator challenge has 10 bro
0
def validator(password):
integers = list(range(10))
integers = [str(i) for i in integers]
specials = ['!','@','#','#x27;,'%','#x27;,'*']
passlist = []
passlist[:0] = password
d, s = 0,0
if len(passlist) >= 7:
for c in passlist:
if c in passlist:
s += 1
if s >= 2:
for c in passlist:
if c in integers:
d += 1
if d >= 2:
print('Strong')
else:
print('Weak')
else:
print('Weak')
else:
print('Weak')
passwd = input()
validator(passwd)
0
Ohh, ok then
0
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ and i passed them all except for 8
0
Kith Stack
Because you have 2 times $ in specials list, there should be $ and &
- 3
You are on pro version, meaning you can access all test cases. If so, help me with test case 8 for password validator.