-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathATM-1-successfull.py
82 lines (72 loc) · 1.84 KB
/
ATM-1-successfull.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
global b
b=20000
def home():
print('\r')
print("-"*80)
print(" WELCOME TO 'ATM' ")
print("-"*80)
print('\r')
print(" PRESS 1 TO CHECK BALANCE ->")
print('\r')
print(" PRESS 2 TO DEPOSIT AMOUNT ->")
print('\r')
print(" PRESS 3 TO ASK FOR LOAN ->")
print('\r')
print(" PRESS 4 TO WITHDRAW AMOUNT ->")
print('\r')
def balance():
global b
return(b)
def deposit(amt):
global b
b=(b+amt)
print("You have successfully deposited = Rs. '",amt,"' in your account.")
return(b)
home()
def loan_lelo(amt):
global b
if (amt <= 1/2(b)):
print("Successful ur loan has been granted")
b = (b+amt)
print(b)
return(b)
home()
else:
print("Increase your balance ,loan cannot be granted")
home()
def withdraw(amt):
global b
if(amt<=b):
b=(b-amt)
print("You have withdrawn '",amt,"' from your account.")
return(b)
home()
home()
while True:
a=int(input("Enter your choice ->"))
if(a==1):
print(balance())
elif(a==2):
c=int(input("Enter the amount you want to deposit ->"))
d=deposit(c)
print(b)
elif(a=3):
c=int(input("Enter the loan amount that you want ->"))
d=loan(c)
print(balance())
elif(a==4):
e=int(input("Enter the amt you want to withdraw ->"))
withdraw(e)
a=input("Do you want to check your total balance ->.(y/n)")
if(a=='y'):
print(balance())
home()
else:
c=input("Do you want to check more. ->(y/n)")
if(c=='y'):
home()
else:
break
else:
break
#WORKING CODE