def hamming(text1,text2):
    """calculates hamming distance between 2 texts of equal length, if not equal it throws an error"""
    distance=0
    if len(text1)!=len(text2):
        return "Error"
    else:
        for i in range(len(text1)):
            if text1[i]!=text2[i]:
                distance+=1
            else:
                continue
    return distance