Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://pastebin.com/u/TTpocToXaKep
- password = input("Please enter your password: ")
- # set the min length
- min_length = 8
- # set the required conditions
- has_upper_case = False
- has_lower_case = False
- has_digit = False
- # check the lenght of the password
- if len(password) >= min_length:
- # check for upper case
- for char in password:
- if char.isupper():
- has_upper_case = True
- break
- # check for lower case
- for char in password:
- if char.islower():
- has_lower_case = True
- break
- # check for digit
- for char in password:
- if char.isdigit():
- has_digit = True
- break
- if has_upper_case and has_lower_case and has_digit and len(password) >= min_length:
- print("Password is strong")
- input("") # waiting exit
- else:
- print("Password is not strong")
- input("") # waiting exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement