Skip to content

Commit

Permalink
Merge pull request #34 from IceTheDev2/change-oxford-comma
Browse files Browse the repository at this point in the history
Update password_strength_logic.py
  • Loading branch information
IceTheCoder authored Feb 24, 2023
2 parents bbc1f50 + 4d8cc80 commit 854b9fc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions code/password_strength_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,19 @@ def check_password_complexity() -> None:
for missing_feature in missing_security_features_list:
if len(missing_security_features_list) == 1:
output = str(missing_feature)
elif missing_feature != missing_security_features_list[-1]:
output = output + str(missing_feature) + ', '
elif len(missing_security_features_list) == 2:
if missing_feature != missing_security_features_list[-1]:
output = output + str(missing_feature) + ' and '
else:
output = output + str(missing_feature)
else:
output = output + 'and ' + str(missing_feature)

if missing_feature == missing_security_features_list[-2]:
output = output + str(missing_feature) + ', and '
elif missing_feature == missing_security_features_list[-1]:
output = output + str(missing_feature)
else:
output = output + str(missing_feature) + ', '

return f'Not complex: Your password is missing {output}.'

else:
Expand Down

0 comments on commit 854b9fc

Please sign in to comment.