B03C-2015D – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Exam Questions-CBSE12D-2015-B03C #PYTHON#6539    siteicon   siteicon  

Problem Statement - B03C-2015D

Write PUSH (Books) and POP (Books) methods in python to add Books and remove Books considering them to act as Push and Pop operations of Stack.

Solution

TC++ #6539

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())


Share

CSKC| Created: 14-Jan-2019 | Updated: 14-Jan-2019|CBSE12D-2015









Back