def has_duplicates(t):
    """True if any element occurs multiple times in t
    """
    s = sorted(t) # sorted copy of t
    # Check each element against the following element.
    # Since it's sorted, identical elements will be adjacent.
    # Use range(len(s)-1), since we'll always be checking the next
    # element, so no need to go out to the last element.
    for i in range(len(s)-1):
        if s[i] == s[i+1]:
            # Found a duplicate!
            return True
    # If we didn't return True already, there are no duplicates
    return False