ropering / Study

0 stars 0 forks source link

[Python] has_duplicate #2

Open ropering opened 2 years ago

ropering commented 2 years ago
def has_duplicates(lst):
    return len(lst) != len(set(lst))

has_duplicates([1,1,2,3,4,5]) # True
has_duplicates([1,2,3,4,5]) # False