-
Notifications
You must be signed in to change notification settings - Fork 0
/
bank.py
84 lines (64 loc) · 1.59 KB
/
bank.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
class Bank:
def __init__(self,Id,FName,SName,Amount):
self.Id=Id
self.FName=FName
self.SName=SName
self.Amount=Amount
def get(self,idd,fname,sname,amount):
ob=Bank(idd,fname,sname,amount)
save.append(ob)
def display(self,ob):
print("Id:",ob.Id)
print("FName:",ob.FName)
print("LName:",ob.SName)
print("Amount:",ob.Amount)
def search(self,fd):
for i in range(save.__len__()):
if(save[i].Id==fd):
return i
def delete(self,fd):
d=obj.search(fd)
del save[d]
def edit(self,fd):
a=obj.search(fd)
del save[a]
return En
ob=Bank(idd,fname,sname,amount)
save[i].Id==NO;
def pr():
a=("Press Any Button \n A.Add Coustomer \n S.Display Coustomer Detail \n E.Edit Coustomer Detail \n DE.Delete Detail of Coustomer \n Q.Exit")
print(a)
save=[]
obj=Bank(0,"","",0)
pr()
z=0
while z==0:
btn=input("Enter your choose: ")
if (btn=="A"):
En=obj.get(input("Enter Id:"),input("Enter FName:"),input("LName:"), input("Enter Amount:") )
for i in range(save.__len__()):
obj.display(save[i])
pr()
elif (btn=="D"):
obj.delete(input("Enter Id:"))
for i in range(save.__len__()):
obj.display(save[i])
pr()
elif (btn=="E"):
obj.edit(input())
print(save.__len__())
print("Edit")
print("")
En=obj.get(input("Enter Id:"),input("Enter FName:"),input("LName:"), input("Enter Amount:") )
for i in range(save.__len__()):
obj.display(save[i])
print("Succesfully Edit")
pr()
elif (btn=="Q"):
print("Thanks you")
elif (btn=="S"):
for i in range(save.__len__()):
obj.display(save[i])
pr()
else:
print("error")