Class 2 Lab 8 ‐ Password Strength Checker - Justin-Boyd/Python-Class GitHub Wiki

Task 1

  • Click on File from the top menu and select New File. Verify the displayed workspace is /home/student/workspace, type main.py as the file name, and click OK.

Task 2

pass_strength = True

Task 3

user_password = input("insert password to check strength >> ")

Task 4

if len(user_password) < 8:
    print("Password must be at least 8 characters.")
    pass_strength = False

Task 5

if user_password.islower():
    print("Password does not contain uppercase letters.")
    pass_strength = False

Task 6

if user_password.isupper():
    print("Password does not contain lowercase letters.")
    pass_strength = False

Task 7

if user_password.isdigit():
    print("Password does not contain lowercase or uppercase letters.")
    pass_strength = False

Task 8

if "0" not in user_password and \
    "1" not in user_password and \
    "2" not in user_password and \
    "3" not in user_password and \
    "4" not in user_password and \
    "5" not in user_password and \
    "6" not in user_password and \
    "7" not in user_password and \
    "8" not in user_password and \
    "9" not in user_password:

    print("Password must contain at least 1 digit.")
    pass_strength = False

Task 9

if pass_strength:
    print("Password is strong !")
else:
    print("Password is weak !")