Created
September 7, 2020 00:55
-
-
Save berviantoleo/b626a1f49f0fcaed579341d80d283d44 to your computer and use it in GitHub Desktop.
Check List Password Duplication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def checkIfDuplicates(listOfElems): | |
''' Check if given list contains any duplicates ''' | |
setOfElems = set() | |
for elem in listOfElems: | |
if elem in setOfElems: | |
return True | |
else: | |
setOfElems.add(elem) | |
return False | |
lines = [] | |
with open("pass-list.txt", "r") as f: | |
for line in f: | |
line = line.strip() | |
lines.append(line) | |
print(checkIfDuplicates(lines)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment