Returns the object at the top of the specified stack object without removing it from the stack.
Syntax
peek( stack )
stack.peek( )
Parameters
stack
|
the stack object to check.
|
Returns
object
|
the object at the top of the specified stack object.
|
Example
obj = s.peek( )
print( obj )
|