Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Our code begins with the usual Unix start-up line, which, we repeat, will be harmlessly ignored on all non-Unix systems. What follows are three from-import statements which load string.lower() for case-insensitive input verification, random.randint() for choosing the arithmetic operands, random.choice() for picking the arithmetic operation, and all the arithmetic operations we need from the operator module.