python判断密码是否8位以上,是否包

北京中科白癜风医院助力健康中国 https://auto.qingdaonews.com/content/2018-06/19/content_20138493.htm

这应该是全网最简单的密码检测的吧,不需要任何的三方库也不需要正则判断,就是原生的字符串函数。

唯一的缺点是一行代码太长,不符合书写规范。

defcheck_password(password):

iflen(password)7andnotpassword.islower()andnotpassword.isupper()andnotpassword.isdigit():

returnTrue

else:

returnFalse

print(check_password(input()))

如果对您有帮助,请点个赞呗

代码原创,转载请注明出处




转载请注明:http://www.aierlanlan.com/cyrz/4813.html

  • 上一篇文章:
  •   
  • 下一篇文章: