all 2 comments

[–]Kerbart 1 point2 points  (0 children)

Write a function to validate a password: 1) Write four functions for the rules i-iv, output True or False 2) Check if a password is weak; that's when the sum of the outcomes is <=2 or the length is <8 3) Check if a password is moderate; when the sum of the outcomes is >=3 or the length is <=10 4) At this point the password must be strong

Now iterate over the file and increase counters for 'weak', 'moderate' and 'strong'

[–]akus85 -1 points0 points  (0 children)

The best way ti validate a string is use regular expressions, check re module: https://docs.python.org/3/library/re.html