Write PUSH(names) method in python to add names considering them to act as PUSH operations in stack.
i will report all wrong answers
Answers
Answered by
1
class Stack:
def __init__(self):
self.items = []
def push(self, item):
self.items.append(item)
def size(self):
return len(self.items)
s = Stack()
print(s.size())
s.push("Aishwarya")
s.push("Harshita")
s.push("Chamanlal")
print(s.size())
Similar questions