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
0
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()}")
Similar questions
Math,
2 months ago
Hindi,
2 months ago
Hindi,
2 months ago
Computer Science,
5 months ago
India Languages,
5 months ago
Physics,
11 months ago
Math,
11 months ago
Physics,
11 months ago