Friday, 12 February 2021

Practical No.17: Write a menu driven program which insert , deleite and display the details of a movie as mid,mname and rating using stack.


'''

Practical No.17: Write a menu driven program which insert , deleite and display the details of a movie as mid,mname and rating using stack.

'''


Movie=[]

c='y'

while(c=='y' or 'Y'):

    print("1:Add Movie Details:")

    print("2:Delete Movie Details:")

    print("3:Display Movie Details:")

    choice=int(input("Enter Your Choice:"))

    if(Choice==1):

        mid=int(input("Enter Movie id: "))

        mname=input("Enter Movie Name: ")

        rating=float(input("Enter Movie Rating: "))

        mov= (mid,mname,rating)

        movie.append(mov)

    elif(Choice==2):

        if(Moivie==[]):

            print("stack empty")

        else:

            print("Deleted element is: "movie.pop())

    elif(Choice==3):

        L=len(movie)

        while(L>0):

            print(movie[L-1])

            L=L-1

    else:

        print("wrong input")

        c=input("Doyou want to continue? press 'y' to continue: ")





 


No comments:

Post a Comment