Advertisement
paid4fame

Random Password gen

Jul 23rd, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import random
  2.  
  3. print("enter if you want a weak, avg or strong password")
  4.  
  5.  
  6. passList = "QWERTYUIOPASDFGHJKLZXCVBNM"
  7. passList2 = "qwertyuiopasdfghjklzxcvbnm"
  8. passList3 = "1234567890!@#$%^&*()_+"
  9.  
  10. newPassword = input()
  11.  
  12. def weakpass():
  13.         newpass = random.sample(passList , 8)
  14.         newpass = "".join(newpass)
  15.         print(newpass)
  16.  
  17. def avgpass():
  18.     avglist = passList + passList2
  19.     newpass = random.sample(avglist, 8)
  20.     newpass = "".join(newpass)
  21.     print(newpass)
  22.  
  23. def strongpass():
  24.     strlist = passList + passList2 + passList3
  25.     newpass = random.sample(strlist, 10)
  26.     newpass = "".join(newpass)
  27.     print(newpass)
  28.  
  29. if newPassword == "weak":
  30.     weakpass()
  31. elif newPassword == "avg":
  32.     avgpass()
  33. elif newPassword == "strong":
  34.     strongpass()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement