概述
密码需要符合下面的要求:
8个字符以上,包含数字,大小写,开头不能为特殊字符。
#! /usr/bin/python
import re
password = str(input())
def lenOK(pwd):
if(len(pwd)>=8):
return True
else:
print("WARNING: The password should be at least 8 characters.")
return False
def numberOK(pwd):
pattern = re.compile('[0-9]+')
match = pattern.findall(pwd)
if match:
return True
else:
print("WARNING: The password should include at least 1 number.")
return False
def upperOK(pwd):
pattern = re.compile('[A-Z]+')
match = pattern.findall(pwd)
if match:
return True
else:
print("WARNING: The password should include at least 1 upper character.")
return False
def lowerOK(pwd):
最后
以上就是美好音响为你收集整理的用python编写密码验证程序_用python实现密码校验程序的全部内容,希望文章能够帮你解决用python编写密码验证程序_用python实现密码校验程序所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复