Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b95c13d

Browse files
Update solution.hide.py
1 parent 5121f6c commit b95c13d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎exercises/37-validity-of-password/solution.hide.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
def valid_password(password):
55
pattern = re.compile(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$#@]).{6,12}$')
66

7-
if pattern.match(password):
8-
return "Valid password"
9-
else:
7+
if not pattern.match(password):
108
return "Invalid password. Please try again"
9+
else:
10+
return "Valid password"
1111

1212

1313
print(valid_password("ABd1234@1"))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /