Computer Science, asked by vishugupta0, 4 months ago

write a function in python POP(Book) where Book is a list of book titles implemented as a stack data structure. The function should return the value deleted from the stack.​

Answers

Answered by Mister360
3

Explanation:

Code:-

class Stack:

def __init__(self):

self.items = []

def isEmpty(self):

return self.items == []

def push(self, item):

self.items.append(item)

def pop(self):

return self.items.pop()

def peek(self):

return self.items[len(self.items)-1]

def size(self):

return len(self.items)

Similar questions