Home

Published

- 1 min read

program to implement stack for book details(book no, book name). implement push and display operation

img of program to implement stack for book details(book no, book name). implement push and display operation

The solution for this is noted below

program to implement stack for book details(book no, book name). implement push and display operation

Solution

   def push(Books):
	Stack.append(Books)
	print 'Element:', Book, 'inserted successfully'
def pop():
	if Stack == []:
		print('Stack is empty!')
	else:
		print('Deleted element is',Stack.pop())

Try other methods by searching on the site. That is if this doesn’t work