Given a singly linked list, write code to detect if there is a loop in it.
Asked in the Technical Round stage. For grading, represent the list with values and pos: node i points to node i + 1, except the final node points to node pos; pos = -1 means it points to None.
Implement has_loop(values, pos). Return True if the encoded list contains a loop, otherwise return False.
def has_loop(values, pos):