<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"""This module provides functions to manipulate nd vectors.

This program uses lists to represent vectors, i.e.,
    my_vector = [1,2,3,4] # 4D vector
"""

def addition_vec_n(a, b):
    """Add two nd vectors and return the sum.

    :param a: The first vector.
    :param b: The second vector.
    :return: The sum of a and b.
    """
    sum_ = []
    for i in range(len(a)):
        sum_.append(a[i] + b[i])

    return sum_

def multiply_vec_n(a, b):
    """Multiply two nd vectors elementwise and return the resulting vector.

    :param a: The first vector.
    :param b: The second vector.
    :return: The sum of a and b.
    """
    prod = []
    for i in range(len(a)):
        prod.append(a[i] * b[i])

    return prod

def dot_vec_n(a, b):
    """Compute dot product of two nd vectors.

    :param a: The first vector.
    :param b: The second vector.
    :return: The dot product of a and b.
    """
    sum_ = 0
    for i in range(len(a)):
        sum_ += a[i]*b[i]
    return sum_
</pre></body></html>