print(astack peek()astack add("wed"astack add("thu"print(astack peek()when the above code is executedit produces the following resulttue thu pop from stack as we knowwe can remove only the top most data element from the stackwe implement python program which does that the remove function in the following program returns the top most element we check the top element by calculating the size of the stack first and thenuse the in-built pop(method to find out the top most element class stackdef __init__(self)self stack [def add(selfdataval)use list append method to add element if dataval not in self stackself stack append(datavalreturn true elsereturn false use list pop method to remove element def remove(self)if len(self stack< return ("no element in the stack"elsereturn self stack pop(astack stack(astack add("mon"astack add("tue"