How to check if there are duplicates in a list of integers with Python

1 Answer

0 votes
def checkDuplicates(lst):
    if len(lst) == len(set(lst)):
        return False
    else:
        return True
        
lst = [8, 3, 1, 3, 6, 5, 5, 1, 9]

print(checkDuplicates(lst))




'''
run:

True

'''

 



answered Aug 19, 2021 by avibootz
...