MCPcopy Index your code
hub / github.com/geekcomputers/Python / peek

Function peek

stackF_Harsh2255.py:34–37  ·  view source on GitHub ↗
(stack)

Source from the content-addressed store, hash-verified

32
33# Function to return the top from stack without removing it
34def peek(stack):
35 if isEmpty(stack):
36 return str(-maxsize - 1) # return minus infinite
37 return stack[len(stack) - 1]
38
39
40# Driver program to test above functions

Callers

nothing calls this directly

Calls 1

isEmptyFunction · 0.70

Tested by

no test coverage detected