Question: Please type in the programs and make them work: Stack using Arrays s = Stack() print(s.is_empty()) s.push(4) s.push(dog) s.push(cat) s.push(zebra) print(s.peek()) s.push(True) print(s.size()) print(s.is_empty()) s.push(8.4)
Please type in the programs and make them work:
Stack using Arrays
s = Stack()
print(s.is_empty())
s.push(4)
s.push("dog")
s.push("cat")
s.push("zebra")
print(s.peek())
s.push(True)
print(s.size())
print(s.is_empty())
s.push(8.4)
s.push("sorry")
print(s.pop())
print(s.pop())
print(s.size())
print(s.peek())
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
