Ask coding questions

← Back to all posts
how to Password reset program
NoahRahmanBonni (0)

Password reset program
Only accept a new password if it is:
1. At least eight characters long
2. Has lower case and upper case letters.
3. Contains a number

Coder100 (16989)

print(len(password) > 8 and password.lower() != password and any(chr.isdigit() for chr in password))


ok basically its a and condition.
The first one checks the length
the second checks if it is different cased, because a Capital will never equal a capital.
The third checks if there was a number.