Skip to content

Commit 6c530fa

Browse files
authored
Loan - functionality has been added
loan functionality has been added
1 parent 3f0c535 commit 6c530fa

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

ATM-1-successfull.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ def home():
1111
print('\r')
1212
print(" PRESS 2 TO DEPOSIT AMOUNT ->")
1313
print('\r')
14-
print(" PRESS 3 TO WITHDRAW AMOUNT ->")
14+
print(" PRESS 3 TO ASK FOR LOAN ->")
1515
print('\r')
16+
print(" PRESS 4 TO WITHDRAW AMOUNT ->")
17+
print('\r')
18+
1619
def balance():
1720
global b
1821
return(b)
@@ -23,6 +26,19 @@ def deposit(amt):
2326
print("You have successfully deposited = Rs. '",amt,"' in your account.")
2427
return(b)
2528
home()
29+
30+
def loan_lelo(amt):
31+
global b
32+
if (amt <= 1/2(b)):
33+
print("Successful ur loan has been granted")
34+
b = (b+amt)
35+
print(b)
36+
return(b)
37+
home()
38+
else:
39+
print("Increase your balance ,loan cannot be granted")
40+
home()
41+
2642
def withdraw(amt):
2743
global b
2844
if(amt<=b):
@@ -41,7 +57,11 @@ def withdraw(amt):
4157
c=int(input("Enter the amount you want to deposit ->"))
4258
d=deposit(c)
4359
print(b)
44-
elif(a==3):
60+
elif(a=3):
61+
c=int(input("Enter the loan amount that you want ->"))
62+
d=loan(c)
63+
print(balance())
64+
elif(a==4):
4565
e=int(input("Enter the amt you want to withdraw ->"))
4666
withdraw(e)
4767
a=input("Do you want to check your total balance ->.(y/n)")

0 commit comments

Comments
 (0)