6.3.2 Using lists as buffersThe following example demonstrates the use of a list as a buffer in which the first item added to the stack is the first one to be popped: pyxplot> myList = [] The function prime(x) returns true if x is a prime number, and false otherwise. In the final line, we make use of the fact that a list tests true if it contains any items, or false if it is empty.
|