Bookstack=[]
def stack_create():
A=input("Enter Book Name")
B=input("Enter Book's Author Name ")
C=input("Enter The Book's publication year")
data=[A,B,C]
Bookstack.append(data)
def pop_book():
if len(Bookstack)==0:
print("Stack IS IN UNDERFLOW ")
else:
C=Bookstack[-1]
c="Removed output is Book name " + C[0] + " Book's author is " + C[1] + " Book's publication year is" + C[2]
print(c)
Bookstack.pop()
def peep():
if len(Bookstack)==0:
print("Stack IS IN UNDERFLOW ")
else:
A=Bookstack[-1]
c="Book Name is " + A[0] + " Book's Author Name is " + A[1] + " Book's Publication deate is " + A[2]
print(c)
def Display():
if len(Bookstack)==0:
print("Stack IS IN UNDERFLOW ")
elif len(Bookstack)>0:
D=len(Bookstack)-1
for i in range (D,-1,-1):
A=Bookstack[i]
c="Book Name is " + A[0] + " Book's Author Name is " + A[1] + " Book's Publication date is " + A[2]
print(c)
while True:
F=int(input("""Enter the funtion you want to perform
press 1 to add a new book
press 2 to remove the top book
press 3 to see the top most Book
press 4 to display the stack
press 5 to exit the program """))
if F == 1:
stack_create()
elif F == 2:
pop_book()
elif F == 3:
peep()
elif F == 4:
Display()
else:
break
----------------------------------
SELECT StudentName FROM Student WHERE Marks > 80;
SELECT StudentName, SubjectName
FROM Student, Subject
where Student.StudentID = Subject.StudentID;
SELECT COUNT(StudentName) AS "Total Students of 12th" FROM Student WHERE Class = "12th";
SELECT AVG(Marks) AS AverageMarks FROM Student;
———————————-
SELECT StudentName FROM Student WHERE Marks > 80;
SELECT StudentName, SubjectName
FROM Student, Subject
where Student.StudentID = Subject.StudentID;
SELECT COUNT(StudentName) AS “Total Students of 12th” FROM Student WHERE Class = “12th”;
SELECT AVG(Marks) AS AverageMarks FROM Student;