class Ref(object):
    def __init__(self, value=None):
        self.value = value

def harmonic_sum(i, lo, hi, term):
    
    temp = 0
    i.value = lo
    while i.value <= hi:  
        temp += term() 
        i.value += 1   
    return temp

i = Ref()



print harmonic_sum(i, 1, 100, lambda: 1.0/i.value)