+ 3
How to debug this?
Sololearn gives me a X in test case 13 which seems to be a hidden case. https://code.sololearn.com/cbVJPlN5s5Ty/?ref=app
22 odpowiedzi
0
Abs Sh It seems like my suspicion was right; itertools.groupby() is the culprit:
https://code.sololearn.com/cRjwkxPHTN5p/?ref=app
+ 2
Abs Sh How about using a random password generator to debug your code?
+ 2
Here's a simpler version
k = input()
print("Strong" * (len(k) > 6 and sum(x.isdigit() for x in k) > 1 and sum(x in "!@#$%&*" for x in k) > 1) or "Weak")
# Hope this helps
+ 2
https://code.sololearn.com/c8N8Q4oXk2qG/?ref=app
Try this out
+ 1
Calvin Thomas thanks
+ 1
Group by makes multiple list with same key so i should have sum all of it together i should admit though your code was much better
https://code.sololearn.com/cHWDJnWxPGJR/?ref=app
+ 1
I still don't understand why people love to make large codes instead of small ones. Is efficiency an advantage? Sometimes.
+ 1
Try making the numbers 0-9 (including 9)
0
You're interviewing to join a security team. They want to see you build a password evaluator for your technical interview to validate the input.
Task:
Write a program that takes in a string as input and evaluates it as a valid password. The password is valid if it has at a minimum 2 numbers, 2 of the following special characters ('!', '@', '#', '#x27;, '%', '&', '*'), and a length of at least 7 characters.
If the password passes the check, output 'Strong', else output 'Weak'.
Input Format:
A string representing the password to evaluate.
Output Format:
A string that says 'Strong' if the input meets the requirements, or 'Weak', if not.
Sample Input:
Hello@$World19
Sample Output:
Strong
0
The password should be "Strong" if its total lenght is at least 7 (including the special characters and the numbers)
0
Angelo Yeah thats what i'm doing
0
There doesn't seem to be a problem
0
Maybe it wants exactly 2 special characters
0
Angelo didn't work
0
Abs Sh Oh, I had thought that groupby gives the result in a single step.
0
It was my first time using it as well just passed it once in docs
0
What about this code ?
https://code.sololearn.com/cxK47lZE4kE7/?ref=app
anything can be helpful because i'm just a beginner
0
Check out my code for this
https://code.sololearn.com/cvq2J1nNxpER/?ref=app
0
Sully Bakz Take an axe and start hacking down small trees. You'll eventually succeed... as a hacker and as well as a mass-deforestation creator.
0
how about this?
https://code.sololearn.com/cx4fiETS9QIS/?ref=app
It managed to pass the test, and did not require complicated solutions
Remember the zen of Python.