def withdraw(): while True: account = input('请输入提现金额: q退出!').strip() if account=='q': break if account.isdigit(): account = float(account) account_user = bank.get_account(user_info['name']) if account_user > account*1.05: bank.withdraw(user_info['name'],account) print('提现成功!') else: print('账户金额不足!') else: print('金额必须是数字!')
def withdraw(): print('\033[32m取现\033[0m') amount = input_integer('请输入取现金额') if amount == 'q': return flag, msg = bank.withdraw(CURRENT_USER, amount) if flag: print('\033[32m%s\033[0m' % msg) else: print('\033[31m%s\033[0m' % msg)
def withdraw(): print('\033[32m取现\033[0m') while True: amount = input('请输入取现金额 >>: ').strip() if not amount.isdigit(): print('\033[32m转账金额必须是数字!\033[0m') continue amount = int(amount) break if bank.withdraw(user_data['name'], amount): print('\033[32m用户%s取现成功!\033[0m' % user_data['name']) else: print('\033[31m用户%s取现失败!\033[0m' % user_data['name'])
def withdraw(): print('\033[32m取现\033[0m') while True: amount = input('请输入取现金额 >>: ').strip() if amount == 'q': break if not amount.isdigit(): print('\033[31m转账金额必须是数字!\033[0m') continue amount = int(amount) flag, msg = bank.withdraw(USER, amount) if flag: print('\033[32m%s\033[0m' % msg) return else: print('\033[31m%s\033[0m' % msg)