0
I'm stuck on the password validation challenge. Would anyone be able to explain the issue with this code please?? 😁
3 Antworten
+ 2
The password 1234567 is in this code „strong“ which is not true.
+ 2
Maximus Hillius very nice idea / approach, i really like it!!
But that there are some issues with any()...
1. You cant simply multiply by 2... This lead to true * 2, when x is digit, or false *2, when x is not digit...
2. special_characters is always true (even more, when doubled :)), thats why it simply does not matter, whether you use a special char or not...
Try replacing your rules for this:
rules = [lambda p: len(p) >= 7, lambda p: sum(x.isdigit() for x in p) >= 2, lambda p: sum(x in special_characters for x in p) >= 2]
+ 1
Thank you both so much!! It's been bugging me for a long time 😅