简易银行ATM存取款系统,atm存取款,ID = 999PASS


ID = 999PASSWORD = 111MONEY = 10000ID_ZHUAN = 123IS_GOON = 0WRONGTIME = 0print("欢迎使用幻蓝ATM存取款一体机。")while (IS_GOON == 0) :    if WRONGTIME > 0 :        print("输入错误,请重新输入。")    print("请输入您的卡号:")    id = int(input())    print("请输入您的密码:")    password = int(input())    if id == ID and password == PASSWORD :        IS_GOON = 1    else :        WRONGTIME += 1        if WRONGTIME > 2 :            print("您密码输入错误次数已超过3次,感谢您的使用。")            breakprint("---------------------------------------")while IS_GOON == 1 :    print("请选择您需要操作的项目:")    print("1.存款")    print("2.取款")    print("3.转账")    print("4.查看余额")    print("5.修改密码")    print("---------------------------------------")    num_caozuo = int(input())    if num_caozuo == 1 :        print("请输入您要存入的金额:")        money = int(input())        MONEY = MONEY + money        print("存款成功。")        print("您当前的余额为:",MONEY)    elif num_caozuo == 2 :        print("请输入您要取出的金额:")        money = int(input())        if money < MONEY :            MONEY = MONEY - money            print("取款成功。")            print("您当前的余额为:",MONEY)        else :            print("取款失败,账户余额不足。")    elif num_caozuo == 3 :        print("请输入您要转入的账户ID:")        id_zhuan = int(input())        if id_zhuan == ID_ZHUAN :            print("请输入您要转出的金额:")            money = int(input())            if money < MONEY :                print("转账成功。")            else :                print("帐户余额不足。")        else :            print("您想转入的账号不存在。")    elif num_caozuo == 4 :        print("您当前的余额为:",MONEY)    elif num_caozuo == 5 :        print("请输入您的原密码:")        password = int(input())        if password == PASSWORD :            print("请输入您的新密码:")            password_new1 = int(input())            print("请再次输入您的新密码:")            password_new2 = int(input())            if password_new1 != password_new2 :                print("两次密码输入不一致,取消修改。")            else :                PASSWORD = password_new1                print("修改成功。")        else :            print("当前密码输入错误,取消修改。")    print("---------------------------------------")    print("是否还需要进行其他操作:(是请输入1,否请输入2)")    is_goon = int(input())    if is_goon == IS_GOON :        continue    else :        print("感谢您的使用,再见。")#该片段来自于http://byrx.net

评论关闭