#!/usr/bin/env python sum = 0.0 for i in range(1, 11): sum += 1.0 / i print "%2d %6.4f" % (i , sum)
[kd@kdlappy book]$ ./evaluateequ.py 1 1.0000 2 1.5000 3 1.8333 4 2.0833 5 2.2833 6 2.4500 7 2.5929 8 2.7179 9 2.8290 10 2.9290