Advertisement
Guest User

Untitled

a guest
May 19th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. weak_list = list("qwertyuiopasdfghjklzxcvbnm")
  2. strong_list = weak_list + list("`-=[];',./~!@#$%^&*()_+}{|:<>?")
  3. import random
  4.  
  5. def pass_gen(n,strength = True):
  6. return random.sample(strong_list,n) if strength == True else random.sample(weak_list,n)
  7.  
  8. if __name__ == "__main__":
  9. n = raw_input("Enter length of your password: (Optional enter <Length Strength> - True or False): ").split()
  10. print ''.join(pass_gen(int(n[0]))) if len(n) == 1 else ''.join(pass_gen(int(n[0]),n[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement