zoukankan      html  css  js  c++  java
  • 验证用户密码程序

    #验证用户密码程序,用户只有三次机会输入密码,如果三次输入错误程序退出,如果输入*则不包含一次机会。
    scode='wang'
    chance=3
    print('您好,请输入密码,以回车键结束:')
    while chance:
        ecode=input('请输入密码:')
        if ecode==scode:
            print('欢迎登陆!')
            break
        elif '*'in ecode:
            print('密码中不能带*,您还有',chance,'机会,请重新输入:')
            continue
        else:
            print('密码错误,你还有',chance-1,'次机会')
            if chance==0:
                print('密码输错三次,今日无法登陆')
        chance-=1
  • 相关阅读:
    多线程
    泛型
    枚举、注解
    重写comparater比较器
    Arrays工具类和Collections工具类
    重写equals和hashCode的方法
    遍历集合的方法
    关键字总结
    having 的用法
    HTTP协议
  • 原文地址:https://www.cnblogs.com/themost/p/6358870.html
Copyright © 2011-2022 走看看