<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transformByDistance(wV, subModel, alphabetSize=4):
 """ transform wV by given substitution matrix """

    nc = [0.0]*alphabetSize
    for i in xrange(0, alphabetSize):
        j = wV[i]
        k = subModel[i]
        for l in xrange(0, alphabetSize):
            nc[l] += j * k[l]
    return nc