<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def weighted_hamming(b1, b2):
 """ Hamming distance that emphasizes differences earlier in strings. """

    assert(len(b1) == len(b2))
    hamming = 0
    for i in range(len(b1)):
        if b1[i] != b2[i]:
            # differences at more significant (leftward) bits
            # are more important
            if i > 0:
                hamming += 1 + 1.0/i
                # This weighting is completely arbitrary
    return hamming