We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5121f6c commit b95c13dCopy full SHA for b95c13d
exercises/37-validity-of-password/solution.hide.py
@@ -4,10 +4,10 @@
4
def valid_password(password):
5
pattern = re.compile(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$#@]).{6,12}$')
6
7
- if pattern.match(password):
8
- return "Valid password"
9
- else:
+ if not pattern.match(password):
10
return "Invalid password. Please try again"
+ else:
+ return "Valid password"
11
12
13
print(valid_password("ABd1234@1"))
0 commit comments