-
Notifications
You must be signed in to change notification settings - Fork 0
/
ATM.py
55 lines (43 loc) · 1.24 KB
/
ATM.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
def Start_Menu():
print("*****MENU*****")
print("1. Check Ballance.")
print("2. Deposit Money.")
print("3. Withdraw Money.")
print("4. Transfer Money.")
print("5. Logout.")
option=int(input("Option(1-5):"))
return option
def check_ballance(ballance):
print(f"Your Ballance:{ballance}")
def deposit_money(ballance):
deposit_amount=float(input("Deposit Amount: "))
ballance+=deposit_amount
print(ballance)
return ballance
def withdraw_money(ballance):
withdraw_money=float(input("Withdraw Amount: "))
ballance-=withdraw_money
print(ballance)
return ballance
def transfer_money(ballance):
transfer_money=float(input("Transfer Amount: "))
if transfer_money<ballance:
ballance-=transfer_money
else:
print("Not Enough Money.")
return ballance
def main():
option = Start_Menu()
current_balance = 100000
if option==1:
check_ballance(current_balance)
if option==2:
deposit_money(current_balance)
if option==3:
withdraw_money(current_balance)
if option==4:
transfer_money(current_balance)
if option==5:
print("****THANKYOU FOR BANKING WITH US*****")
if __name__ == '__main__':
main()