用户:千手修罗SUMMIT查看:0 回复:0 评论:0 创建时间:2019-08-16T22:22:42
【作品展示】

【作品介绍】
初级密码判定
【作品源代码】
chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
nums = '0123456789'
symbols = r'''`!@#$%^&*()_+-=/*{}[]\|'";:/?,.<>'''
while True:
a = input('请输入需要检查的密码组合:')
length = len(a)
s = 1
d = 0
f = 0
g = 0
while (a.isspace() or length == 0):
a = input('您输入的密码为空(或空格),请重新输入:')
length = len(a)
if (length >= 9):
s = (s + 1)
for each in chars:
if (each in a):
f = (f + 1)
if (f >= 3):
s = (s + 1)
else:
s = (s - 3)
for each in nums:
if (each in a):
d = (d + 1)
if (d >= 6):
s = (s + 1)
else:
s = (s - 1)
else:
for each in chars:
if (each in a):
g = (g + 1)
if (g >= 3):
s = (s + 1)
else:
s = (s - 1)
if (s <= 1):
print('您的密码安全级别评定为低')
elif (s == 2):
print('您的密码安全级别评定为中')
else:
print('您的密码安全级别评定为高')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn