Page 330 - Beginning Programming with Pyth - John Paul Mueller
P. 330
The message will move to the bottom during the second and subsequent queries.
3. Press Enter.
The application attempts to push another value onto the stack. However, the stack is full, so the task fails, as shown in Figure 14- 13.
4. Press Enter.
The application pops a value from the top of the stack. Remember that 3 is the top of the stack, so that's the value that is missing in Figure 14-14.
5. Press Enter.
The application tries to pop more values from the stack than it contains, resulting in an error, as shown in Figure 14-15. Any stack implementation that you create must be able to detect both overflows (too many entries) and underflows (too few entries).
FIGURE 14-12: A stack pushes values one on top of the other.