Computer Science, asked by aishwarya2942, 5 months ago

Give the necessary declaration of a list implemented stack containingnumeric type data. Also write user defined function to pop a number from the stack. (python)

i will report all wrong answers ​

Answers

Answered by valeriy69
0

\small\mathsf\color{pink}{Solution\: using\: python\: 3}

class Stack:

def __init__(self, nums):

self.nums = nums

def pop(self):

return self.nums.pop()

s = Stack([69, 96, 999])

for x in range(2):

print(f"popped: {s.pop()}")

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

Similar questions