Problem Statement - B03C-2015
Write PUSH (Names) and POP (Names) methods in python to add Names and Remove names considering them to act as Push and Pop operations of Stack.
Solution
CSKC| Created: 11-Jan-2019 | Updated: 11-Jan-2019|CBSE12A-2015
Write PUSH (Names) and POP (Names) methods in python to add Names and Remove names considering them to act as Push and Pop operations of Stack.
|
def push(Name): Stack.append(Name) print ‘Element:',Name,'inserted successfully' def pop(): if Stack == []: print('Stack is empty!') else: print('Deleted element is',Stack.pop())
CSKC| Created: 11-Jan-2019 | Updated: 11-Jan-2019|CBSE12A-2015