Detect a loop in a linked list.
Implement detect_loop(values, pos), where values is a list of node values and pos identifies the index reached by the final node. Use pos = -1 when the final node points to None. Return True if the resulting linked list contains a loop, otherwise return False.
def detect_loop(values, pos):