Q. Write a function in Python, MakePush(Package) and Make Pip(Package), to add a new Package and delete a Package from a List of Package Description, considering them to act as push and pop operations of the Stack data structure.


Answer =

def MakePush (Package):
    a = int (input ("enter package title:"))
    Package.append(a)

def MakeUp (Package) :
    if (Package== []):
        print ("Stack empty")
    else:
        print ("Deleted element:",Package.pop ())




Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post