/python/hamming/hamming.py

1
2
def distance(strand1, strand2):
    return sum(a != b for a, b in zip(strand1, strand2))

@jmetzmeier, @JessicaSachs, @mope, @heinrique, @kwoolytech, and @bfirest1 think this looks great

Comments

I didn't know you could add booleans like this until I tried it here.

helenst commented 3 January 2015 at 11:54 UTC

You're not logged in right now. Please login via GitHub to comment