Maintaining student details like roll, name and per using Queues (Using Functions)
#queue implementation using functions
#program to create a queue of student(rollno,name,per).
"""
Add student
delete student
display details
"""
student=[]
def Add_student():
rollno=input("Enter roll no ")
name=input("Enter name ")
per=input("Enter percntage ")
stu=(rollno,name,per)
student.append(stu)
def del_student():
if(student==[]):
print("Underflow / student queue in empty")
else:
rollno,name,per=student.pop(0)
print("poped element is ")
print("Rollno ",rollno," name ",name," percentage ",per)
def traverse():
if not (student==[]):
n=len(student)
for i in range(0,n):
print(student[i])
else:
print("Empty , No student to display")
while True:
print("1. Add details of Student")
print("2. delete details of student")
print("3. Display details of students")
print("4. Exit")
ch=int(input("Enter your choice "))
if(ch==1):
Add_student()
elif(ch==2):
del_student()
elif(ch==3):
traverse()
elif(ch==4):
print("End")
break
else:
print("Invalid choice")




