Q. Write a function in python, MakePush(Package) and MakePop(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())


8 Comments

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

Post a Comment

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

Previous Post Next Post