Guest User

Untitled

a guest
Apr 25th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import hashlib
  2. import itertools
  3.  
  4. #Que elementos tomara en cuenta para hacer el diccionario
  5. elementos = '20142199PabloAndrésDelaCruzSánchezpdelacruz'
  6.  
  7. def get_only_chars(string):
  8. return "".join(set(string))
  9.  
  10. def proceso(n):
  11. listado= list(itertools.combinations_with_replacement(elementos, n))
  12. with open('dictionary_plain.txt','a+') as dictionaryfile:
  13. for e in range(len(listado)-1):
  14. elemento=str("".join(str(x) for x in listado[e])).replace(' ','')
  15. dictionaryfile.write(elemento+'\n')
  16.  
  17. if __name__=='__main__':
  18. for i in range(1,5): proceso(i)
Add Comment
Please, Sign In to add comment