Skip to content

Instantly share code, notes, and snippets.

@berviantoleo
Created September 7, 2020 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berviantoleo/b626a1f49f0fcaed579341d80d283d44 to your computer and use it in GitHub Desktop.
Save berviantoleo/b626a1f49f0fcaed579341d80d283d44 to your computer and use it in GitHub Desktop.
Check List Password Duplication
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