-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankingAppUsingFunctions1.py
More file actions
69 lines (53 loc) · 1.79 KB
/
Copy pathBankingAppUsingFunctions1.py
File metadata and controls
69 lines (53 loc) · 1.79 KB
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
# Banking App ---> 1. Withdraw, 2. Deposit, 3. Balance Enq, 4. Change PIN
'''
dic = {'name':'Aadhitya','pin':1234,'balance':20000}
def show():
print('----------------------------------------------------------')
print('Welcome to ABC Bank')
print('----------------------------------------------------------')
p = int(input('Enter PIN Number : '))
if p==dic['pin']:
print('\nWelcome',dic['name'])
show2()
else:
print('\nInvalid PIN Number!')
def show2():
print('\nSelect Any Option')
print('\n1. Withdraw 2. Deposit \n3. Balance Enquiry 4. Change PIN Number')
opt = int(input())
check(opt)
def check(o):
if o==1:
withdraw()
elif o==2:
deposit()
elif o==3:
print('\nYour Balance is : ',dic['balance'])
elif o==4:
change()
def withdraw():
amount = int(input('\nEnter the Amount to be Withdrawn : '))
if amount<dic['balance']:
dic['balance']-=amount
print('\nYour Transaction is Successfull')
print('\nBalance Amount = ',dic['balance'])
else:
print('\nInsufficient Balance! Enter the amount within',dic['balance'])
withdraw()
def deposit():
amount = int(input('\nEnter the Amount to be Deposited : '))
dic['balance']+=amount
print('\nDeposited Successfully')
print('\nBalance Amount = ',dic['balance'])
def change():
op = int(input('\nEnter Old PIN Number : '))
if op==dic['pin']:
np = int(input('\nEnter New PIN Number : '))
dic['pin']= np
print('\nYour PIN Number has been changed Successfully!')
else:
print('\nInvalid PIN Number!')
for a in range(10):
show()
'''
dic = {1:{'name':'Aadhitya','pin':1234,'balance':20000},2:{'name':'Lavanya','pin':4567,'balance':10000}}