Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import string
  2.  
  3. def bruteForce(charList,size,nwCombination=[]):
  4. if not nwCombination:
  5. nwCombination=charList
  6. if size==1:
  7. return nwCombination
  8. finalCombination=[]
  9. for x in charList:
  10. for n in nwCombination:
  11. cntStr=str(x)+""+str(n)
  12. finalCombination.append(cntStr)
  13. if(cntStr=='aadd'):
  14. print("string found")
  15. print(cntStr)
  16. exit(0)
  17. return bruteForce(charList,size-1,finalCombination)
  18.  
  19. allCharlist=string.ascii_lowercase+string.ascii_uppercase
  20. bruteForce(list(allCharlist)+list(range(0,9)),5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement