Page 1 of 1

1) The Stack class is implemented with a peek function to show the value of the top item without popping it. What is th

Posted: Mon Mar 21, 2022 4:48 pm
by answerhappygod
1) The Stack class is implemented with a peek function to
show the value of the top item without popping it. What is the item
returned at the last peek of the following code?
m = Stack()
m.push(5)
m.push(6)
m.push(7)
a = m.peek()
m.push(a)
m.pop()
m.pop()
m.peek()