def dot(L, K):
    """returns the dot product of lists L and K"""
    def dotHelp(L, K, accum):
        if (L == [] or K == []):
            return accum
        return dotHelp(L[1:], K[1:], accum+L[0]*K[0])
    
    return dotHelp(L, K, 0)