+1

In password validation test 13 isn't completed and I can't see what's wrong.

Help me please https://code.sololearn.com/c81tbuf8ND1B/?ref=app

2/24/2020 8:57:29 AM

HamsterHom220

12 Answers

New Answer

+4

input: 1abc0a@b$ output: weak expected: strong Your code works only if numbers or specials are together: 12 instead of 1....2

+3

{2,} will only check if the character are next to each other as 🅰🅹 - Pʀᴏᴅᴜᴄᴛ Mᴀɴᴀɢᴇʀ said `password12` will return as true but not `pass1word2`

+2

try r"[!@#$%&*]" idk about python, but usually space count as pattern in regex

+2

just check the task again it said ```The password is valid if it has at a minimum 2 numbers, 2 of the following special characters``` your code doesnt check how much occurence of the characters

+2

Maybe this thread helps to understand the troubles using regex for this challenge. https://www.sololearn.com/Discuss/2124383/?ref=app

+2

HamsterHom220 You can also check nested if statement in just few line like this. if len(password) >= 7 and len(symbol) >=2 and len(number) >=2: print("Strong") else: print("Weak")

+2

There is usually an error message given by Code Coach.

+1

I managed! Thanks to all! https://code.sololearn.com/c6Fp1448yc9s/?ref=app

+1

HamsterHom220 Congrats :)

0

didn't help (

0

HamsterHom220 In that task number should be atlast 2 and special character also should be atlast 2 but you didn't check the occurrence of these things.

0

🅰🅹 - Pʀᴏᴅᴜᴄᴛ Mᴀɴᴀɢᴇʀ See the regex pattern: {2,}