Program 1
import collections
stack=collections.deque()
while(1):
print("\n----------------------------Stack Menu-------------------\n")
print("1.Push\n2.Pop\n3.Display\n4.Exit ")
print("\n------------------------------------------------------------\n")
choice=int(input("Enter your choice"))
if(choice==1):
n=int(input("Enter an element for push"))
stack.append(n)
elif(choice==2):
if(not stack):
print("Stack is empty")
else:
print("Poped element:",stack.pop())
elif(choice==3):
if(not stack):
print("Stack is empty")
else:
for element in stack:
print(element, end=" ")
else:
break