# -*- coding: utf-8 -*-
"""
Created on Sat Oct 19 17:55:27 2019
@author: shark
"""
print( "*Password Strength Assessment Program*" )
password = input( "Enter the password you want to test: " )
if len(password)<8:
strength="WEAK"
elif len(password)>=11 and not password.isalpha() and not password.isdecimal() and not password.isdigit():
strength="STRONG"
else:
strong= 'MEDIUM'
print( "The strength of your password is:", strength)
Password Strength
An institution uses the following rules to classify the strength of passwords:
- A string is a WEAK password if it is less than 8 characters long.
- A string is a STRONG password if:
- it contains at least 11 characters
- AND it contains at least 1 lower case letter
- AND it contains at least 1 capital letter
- AND it contains at least 1 numerical digit.
- A string is a MEDIUM password if it is NOT a WEAK password AND is NOT a STRONG password.
You need to write code that will take input of a string from the keybord and will print the strength of that string as a password, according to the rules given above. So it should output one of the strings WEAK, STRONG or MEDIUM
Note:
Make sure your outputs are exactly the strings WEAK, STRONG or MEDIUM (all in capital letters) otherwise you will lose marks.
Examples:
Examples | |
---|---|
INPUT | OUPUT* |
hello | WEAK |
7Kings8all9Pies | STRONG |
brandon123 | MEDIUM |