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
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
Math,
2 months ago
Social Sciences,
2 months ago
English,
2 months ago
Math,
4 months ago
CBSE BOARD X,
9 months ago