Maintaining Bank details like accno, name and balance using Queues (Using Functions)
#queue implementation using functions
#program to create a queue of bank(acno,name,bal).
"""
Add custmer
delete customer
display details
"""
bank=[]
def Add_customer():
acno=input("Enter account no. ")
name=input("Enter name ")
bal=input("Enter balance ")
b=(acno,name,bal)
bank.append(b)
def del_customer():
if(bank==[]):
print("Underflow / bank queue in empty")
else:
acno,name,bal=bank.pop(0)
print("poped element is ")
print("Accountno ",acno," name ",name," balance ",bal)
def traverse():
if not (bank==[]):
n=len(bank)
for i in range(0,n):
print(bank[i])
else:
print("Empty , No details to display")
while True:
print("1. Add details of bank customer")
print("2. delete details of bank customer")
print("3. Display details of bank")
print("4. Exit")
ch=int(input("Enter your choice "))
if(ch==1):
Add_customer()
elif(ch==2):
del_customer()
elif(ch==3):
traverse()
elif(ch==4):
print("End")
break
else:
print("Invalid choice")




