How to present the answer to an exercise

Use comments to explain ideas
Use descriptive variable names to reduce the need for more comments
Find generic solutions (unless the code size explodes)
Strive at compact code, but not too compact
Always construct a demonstrating running example and include in it the source code file inside triple-quoted strings:
"""
unix> python hw.py 3.1459
Hello, World! sin(3.1459)=-0.00430733309102
"""
Invoke the Python interpreter and run import this

previousnexttable of contents