Computer Science, asked by aishwarya2942, 4 months ago

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 valeriy69
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())

\small\mathsf\color{lightgreen}useful?\: \color{white}\mapsto\: \color{orange}brainliest

Similar questions