Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- import itertools
- #Que elementos tomara en cuenta para hacer el diccionario
- elementos = '20142199PabloAndrésDelaCruzSánchezpdelacruz'
- def get_only_chars(string):
- return "".join(set(string))
- def proceso(n):
- listado= list(itertools.combinations_with_replacement(elementos, n))
- with open('dictionary_plain.txt','a+') as dictionaryfile:
- for e in range(len(listado)-1):
- elemento=str("".join(str(x) for x in listado[e])).replace(' ','')
- dictionaryfile.write(elemento+'\n')
- if __name__=='__main__':
- for i in range(1,5): proceso(i)
Add Comment
Please, Sign In to add comment