我是靠谱客的博主 美好音响,这篇文章主要介绍用python编写密码验证程序_用python实现密码校验程序,现在分享给大家,希望可以做个参考。

密码需要符合下面的要求:

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实现密码校验程序内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(104)

评论列表共有 0 条评论

立即
投稿
返回
顶部