问题描述:
Write a function to calculate the harmonic sum of n-1.

测试用例:
['assert harmonic_sum(7) == 2.5928571428571425', 'assert harmonic_sum(4) == 2.083333333333333', 'assert harmonic_sum(19) == 3.547739657143682']

生成的代码:
def harmonic_sum(n):
    return sum(1/i for i in range(1, n))

# Test cases
assert harmonic_sum(7) == 2.5928571428571425
assert harmonic_sum(4) == 2.083333333333333
assert harmonic_sum(19) == 3.547739657143682