Pythonの基本的なコーディングATMマシンシステム



Python Basic Coding Atm Machine System



印刷( ’----- XXX ATMへようこそ-----’)
カウント= 1
お金= 1000
userAccount = ‘123456’
userPasswd = ‘654321’
カウントしながら<= 3:
account = input( ‘アカウントを入力してください:’)
passwd = input( ‘パスワードを入力してください:’)
account == userAccountおよびpasswd == userPasswdの場合:
print(「次にやりたいことを選択してください:」)
Trueの場合:
print( ‘1、撤回’)
print( ‘2、deposit’)
print( ‘3、query’)
print( ‘4、exit’)
選択= input()
選択==「1」の場合:
print(「引き出しを選択しました」)
Trueの場合:#撤回サイクル
print(「引き出したい金額を入力してください:」)
take = int(input())
if take%100 == 0:#引き出し額が100の倍数であるかどうかを判断します
お金> =取る場合:#残高は満たされていますか?
money = money-take#お金を引き出した後の残高を計算します
print( ‘引き出し%d、残高%d $%(テイク、マネー))
ブレーク
そうしないと:
print(「バランスが不十分」)
ブレーク
そうしないと:
print(「現金の金額は100の倍数のみです。再入力してください」)

elif choice == '2': Print('You have chosen deposit function') while True: Store = int(input('Please put the banknotes neatly into the banknote:')) if store % 100 == 0: money += store Print('current balance: %d'%money) break else: Print('Cannot put banknotes other than 100') elif choice == '3': Print('You have selected the query function') Print('current balance: %d'%money) elif choice == '4': Print('Please collect your bank card') Break# interrupted is the function selection loop else: Print('The input is incorrect, please re-select:') Break# password cycle else: if count != 3: Print('The account or password is wrong, you still have %d chance!'%(3-count)) else: Print('You have entered the wrong password three times that day, please try again tomorrow!') count+=1