1.
'''stack=[]
def push():
element = input("Enter element to push")
[Link](element)
print(stack,"element has been pushed")
push()
2.stack2=[1,2,3,4,5]
def peek():
print("'\n\nPeek operation allows the user to see the topmost of the last or latest element
which has been \nappended or added to the stack which is basically a list'")
print("\n\n",stack2[-1])
peek()
[Link]=[1,2,3,4]
stackunderflow=[]
def stackflow():
m=4
if len(stackoverflow)==m:
print("Stack Overflow!")
if len(stackunderflow)==0:
print("Stackunderflow!")
stackflow()
[Link]=[1,]
def isEmpty():
if len(stack)==0:
print("stack is empty")
else:
print("Stack is not empty")
isEmpty()'''
5.'''stack=[1,2,3]
def pop():
if len(stack)==0:
print("Stack underflow!")
else:
print("Element Popped",[Link]())
pop()'''
[Link]=[1,2,3]
def clear():
If len(stack)==0:
print(“the sack is empty”)
else:
[Link]()
print(“Stack has been cleared successfully”)
print(stack)
clear()”