Because a set drops repeats on its own, finding how many different values a list has is one line: put them all in a set and look at its size.
len(set(values)) # how many distinct valueslen(set(values)) < len(values) # is there any repeat?
The second line is another answer to "is there a repeat?": if there are fewer distinct values than elements, something repeated. It is short but reads the whole list; the loop version can stop at the first repeat.