import math


def distance(p, q):
    """Finds the distance between two positions in N-dimensional space."""
    square = 0
    for pn, qn in zip(p,q):
        square += (pn-qn)**2
    return math.sqrt(square)