- 4

Some one send me test case 8 for the password validator please

Password validator

13th Aug 2021, 5:05 PM
Kith Stack
14 Respostas
+ 4
Kith Stack Some Test cases are hidden so you need to write generic logic to pass all test cases.
13th Aug 2021, 5:06 PM
A͢J
A͢J - avatar
+ 4
@Kth Stack , Show your attempt please
13th Aug 2021, 5:10 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 4
Rellot's screwdriver No maximum is not 5. In this practice we have more than 5.
13th Aug 2021, 5:14 PM
A͢J
A͢J - avatar
+ 3
Kith Stack Pro and Non-Pro doens't matter for the test cases. Everyone should learn so some test cases should be hidden.
13th Aug 2021, 5:15 PM
A͢J
A͢J - avatar
+ 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;,'%','&','*']
13th Aug 2021, 5:22 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 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)
13th Aug 2021, 5:44 PM
A͢J
A͢J - avatar
+ 1
hmm, when did sololearn have 8 test cases, the maximum is 5
13th Aug 2021, 5:07 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
+ 1
Kith Stack Not 10 there is 13 test cases.
13th Aug 2021, 5:17 PM
A͢J
A͢J - avatar
0
Rellot's screwdriver , the password validator challenge has 10 bro
13th Aug 2021, 5:10 PM
Kith Stack
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)
13th Aug 2021, 5:13 PM
Kith Stack
0
Ohh, ok then
13th Aug 2021, 5:16 PM
Kith Stack
0
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ and i passed them all except for 8
13th Aug 2021, 6:30 PM
Kith Stack
0
Kith Stack Because you have 2 times $ in specials list, there should be $ and &
13th Aug 2021, 7:55 PM
A͢J
A͢J - avatar
- 3
You are on pro version, meaning you can access all test cases. If so, help me with test case 8 for password validator.
13th Aug 2021, 5:08 PM
Kith Stack