import re
value = []
print("请输入:")
items=[x for x in input().split(',')]
for p in items:
if len(p)<6 or len(p)>12:
continue #如果满足条件则返回for循环
else:
pass #进入下一条语句
if not re.search("[a-z]",p):
continue
elif not re.search("[0-9]",p):
continue
elif not re.search("[A-Z]",p):
continue
elif not re.search("[$#@]",p):
continue
elif re.search("s",p):
continue
else:
pass
value.append(p)
print (",".join(value))
结果:
最后
以上就是沉默橘子最近收集整理的关于【Python基础题12】检查用户输入的密码的有效性的全部内容,更多相关【Python基础题12】检查用户输入内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复