Oct-11-2016, 11:27 PM
I am making a program to check if a password is atleast 8 characters long, has atleast 1 special character, has atleast 1 number and atleast 1 capital letter.
password = eval(input("Please enter a password:",)) def check(password): """Returns True only if password is strong enough.""" if (len(password) >= 8 and any(char.isdigit() for char in password) and any(char.islower() for char in password) and any(char.isupper() for char in password)): print("This is an acceptable password") return True else: print("This is not a acceptable password") return False check()If someone could show a correct way of doing this that was would be awesome. And without getting to technical I'm still just getting into python. Ive only just gotten into functions.